diff options
| author | Mohammad Sajid Anwar <Mohammad.Anwar@yahoo.com> | 2024-02-07 21:45:06 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-07 21:45:06 +0000 |
| commit | 6b8e7f926a98c0e54e30ac77e5c7ccf2e7a736cf (patch) | |
| tree | 824aa79e3a22cbdb4e9d48e458a5fbb30e5eedd2 | |
| parent | 960e34c41880d13128dbbc8c8af9ccf8d05bc988 (diff) | |
| parent | bbac99345edb9abe5082f1a9c6da0b4637ef75be (diff) | |
| download | perlweeklychallenge-club-6b8e7f926a98c0e54e30ac77e5c7ccf2e7a736cf.tar.gz perlweeklychallenge-club-6b8e7f926a98c0e54e30ac77e5c7ccf2e7a736cf.tar.bz2 perlweeklychallenge-club-6b8e7f926a98c0e54e30ac77e5c7ccf2e7a736cf.zip | |
Merge pull request #9541 from oWnOIzRi/week255
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 |
