Skip to content

Commit

Permalink
change base implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
art049 committed Oct 18, 2024
1 parent 2e51b04 commit bf515d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_count_even.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

def count_even(arr: list[int]) -> int:
"""Count the number of even numbers in an array."""
return sum(1 for x in arr if x % 2 == 0)
even = 0
for num in arr:
if num % 2 == 0:
even += 1
return even


# Your tests can also be benchmarks
Expand Down

0 comments on commit bf515d0

Please sign in to comment.