Add Big Numbers

Sometimes the numbers in a list are huge, like view counts, money stored in cents, or large system counters. The function a_very_big_sum receives a list of integers ar. Return the sum of all elements without doing any extra conversions.

Примеры

Ввод
[1000000001, 1000000002, 1000000003, 1000000004, 1000000005]
Вывод
5000000015
Ввод
[1, 2, 3]
Вывод
6
Ввод
[0]
Вывод
0

Нужно реализовать

def a_very_big_sum(ar: list[int]) -> int:

Теги

arraymath
PostgreSQLv16

Ovdje će se prikazati rezultat izvršavanja koda

Visible tests
1
Input
[1000000001,1000000002,1000000003,1000000004,1000000005]
Expected5000000015
2
Input
[1,2,3]
Expected6
3
Input
[0]
Expected0
4
Input
[1000000000000,2000000000000]
Expected3000000000000
5
Input
[-5,5,10]
Expected10
6
Input
[]
Expected0
Focus radio
Paused · SomaFM · Fluid