Skip to content
Closed
27 changes: 27 additions & 0 deletions maths/special_numbers/a_very_big_sum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<<<<<<< HEAD

Check failure on line 1 in maths/special_numbers/a_very_big_sum.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

maths/special_numbers/a_very_big_sum.py:1:7: invalid-syntax: Expected a statement

Check failure on line 1 in maths/special_numbers/a_very_big_sum.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

maths/special_numbers/a_very_big_sum.py:1:5: invalid-syntax: Expected a statement

Check failure on line 1 in maths/special_numbers/a_very_big_sum.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

maths/special_numbers/a_very_big_sum.py:1:3: invalid-syntax: Expected a statement

Check failure on line 1 in maths/special_numbers/a_very_big_sum.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

maths/special_numbers/a_very_big_sum.py:1:1: invalid-syntax: Expected a statement
def a_very_big_sum(arr: list[int]) -> int:
Copy link
Copy Markdown

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:
  ^

=======

Check failure on line 3 in maths/special_numbers/a_very_big_sum.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

maths/special_numbers/a_very_big_sum.py:3:7: invalid-syntax: Expected a statement

Check failure on line 3 in maths/special_numbers/a_very_big_sum.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

maths/special_numbers/a_very_big_sum.py:3:5: invalid-syntax: Expected a statement

Check failure on line 3 in maths/special_numbers/a_very_big_sum.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

maths/special_numbers/a_very_big_sum.py:3:3: invalid-syntax: Expected a statement

Check failure on line 3 in maths/special_numbers/a_very_big_sum.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

maths/special_numbers/a_very_big_sum.py:3:1: invalid-syntax: Expected an indented block after function definition
from typing import List

Check failure on line 4 in maths/special_numbers/a_very_big_sum.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

maths/special_numbers/a_very_big_sum.py:3:8: invalid-syntax: Expected a statement


def a_very_big_sum(arr: List[int]) -> int:
>>>>>>> 2e5b8980304014f131c23d43a7a08e624c23de8b

Check failure on line 8 in maths/special_numbers/a_very_big_sum.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

maths/special_numbers/a_very_big_sum.py:8:1: invalid-syntax: Expected an indented block after function definition
"""
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}")

Loading