ALG-E001EasyArrays
Sum the Readings
Return the sum of all integers in numbers. An empty list has a sum of zero.
Contract
input numbers: integer[]
return integer
Constraints
- • 0 <= length <= 1000
- • -100000 <= value <= 100000
Examples
Example 1
numbers = [3, 1, -2, 4]
→ 6
5 judge tests (2 shown above). Target complexity: O(n).