Skip to content

Commit aceb290

Browse files
committed
fixed error
1 parent 4c6121d commit aceb290

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
from typing import List
2-
3-
def a_very_big_sum(arr: List[int]) -> int:
1+
def a_very_big_sum(arr: list[int]) -> int:
42
"""
53
Return the sum of all integers in the input array.
64
7-
>>> a_very_big_sum([2, 4, 6, 2, 4, 6, 3])
8-
27
5+
>>> a_very_big_sum([2, 4, 6])
6+
12
97
>>> a_very_big_sum([])
108
0
11-
>>> a_very_big_sum([1000000000, 2000000000])
12-
3000000000
139
"""
14-
if not all(isinstance(x, int) for x in arr):
15-
raise ValueError("All elements in the array must be integers")
16-
1710
total = 0
18-
for number in arr:
19-
total += number
11+
for i in arr:
12+
total += i
2013
return total
14+
15+
if __name__ == "__main__":
16+
# Example usage
17+
arr = [2, 4, 6, 2, 4, 6, 3]
18+
result = a_very_big_sum(arr)
19+
print(f"Sum of {arr} is {result}")
20+

0 commit comments

Comments
 (0)