Skip to content

Commit bf515d0

Browse files
committed
change base implementation
1 parent 2e51b04 commit bf515d0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_count_even.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

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

812

913
# Your tests can also be benchmarks

0 commit comments

Comments
 (0)