Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions tests/test_count_even.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading