From bbac99345edb9abe5082f1a9c6da0b4637ef75be Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 7 Feb 2024 16:24:34 +0000 Subject: simplify counter initialisation --- challenge-255/steven-wilson/python/ch-1.py | 4 ++-- 1 file 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 -- cgit