diff --git a/tests/test_count_even.py b/tests/test_count_even.py index b1fc605..c62e468 100644 --- a/tests/test_count_even.py +++ b/tests/test_count_even.py @@ -3,11 +3,7 @@ def count_even(arr: list[int]) -> int: """Count the number of even numbers in an array.""" - even = 0 - for num in arr: - if num % 2 == 0: - even += 1 - return even + return sum(1 for i in arr if i % 2 == 0) # Your tests can also be benchmarks