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
Kirjaudu sisään nähdäksesi palautushistorian
Kirjaudu sisäänKirjaudu sisään käyttääksesi tekoälymentoria
Kirjaudu sisäänVisible tests
1
Input
[1000000001,1000000002,1000000003,1000000004,1000000005]Expected
50000000152
Input
[1,2,3]Expected
63
Input
[0]Expected
04
Input
[1000000000000,2000000000000]Expected
30000000000005
Input
[-5,5,10]Expected
106
Input
[]Expected
0Focus radio
Paused · SomaFM · Fluid