Skip to content
Closed
20 changes: 20 additions & 0 deletions maths/special_numbers/a_very_big_sum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def a_very_big_sum(arr: list[int]) -> int:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An error occurred while parsing the file: maths/special_numbers/a_very_big_sum.py

Traceback (most recent call last):
  File "/opt/render/project/src/algorithms_keeper/parser/python_parser.py", line 146, in parse
    reports = lint_file(
              ^^^^^^^^^^
libcst._exceptions.ParserSyntaxError: Syntax Error @ 2:3.
parser error: error at 1:2: expected one of (, *, +, -, ..., AWAIT, EOF, False, NAME, NUMBER, None, True, [, break, continue, lambda, match, not, pass, ~

def a_very_big_sum(arr: list[int]) -> int:
  ^

"""
Return the sum of all integers in the input array.

>>> a_very_big_sum([2, 4, 6])
12
>>> a_very_big_sum([])
0
"""
total = 0
for i in arr:
total += i
return total


if __name__ == "__main__":
# Example usage
arr = [2, 4, 6, 2, 4, 6, 3]
result = a_very_big_sum(arr)
print(f"Sum of {arr} is {result}")