diff options
| author | Steven <steven1170@zoho.eu> | 2024-02-07 16:24:34 +0000 |
|---|---|---|
| committer | Steven <steven1170@zoho.eu> | 2024-02-07 16:24:34 +0000 |
| commit | bbac99345edb9abe5082f1a9c6da0b4637ef75be (patch) | |
| tree | b2223505e6ae763b3ef59eb4455186ba3acf8a07 | |
| parent | 1a1891f44a2067d08ab9ec108eaccd55b789a651 (diff) | |
| download | perlweeklychallenge-club-bbac99345edb9abe5082f1a9c6da0b4637ef75be.tar.gz perlweeklychallenge-club-bbac99345edb9abe5082f1a9c6da0b4637ef75be.tar.bz2 perlweeklychallenge-club-bbac99345edb9abe5082f1a9c6da0b4637ef75be.zip | |
simplify counter initialisation
| -rw-r--r-- | challenge-255/steven-wilson/python/ch-1.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-255/steven-wilson/python/ch-1.py b/challenge-255/steven-wilson/python/ch-1.py index dac2d858ab..14ffcced45 100644 --- a/challenge-255/steven-wilson/python/ch-1.py +++ b/challenge-255/steven-wilson/python/ch-1.py @@ -17,8 +17,8 @@ def odd_character(original, shuffled): if not original or not shuffled: raise ValueError("Both strings must be non-empty.") - original_counter = Counter(x.casefold() for x in original) - shuffled_counter = Counter(x.casefold() for x in shuffled) + original_counter = Counter(original.casefold()) + shuffled_counter = Counter(shuffled.casefold()) difference_counter = shuffled_counter - original_counter |
