← 返回 meta 的题目列表Simple Array Sum
类型:online_judge
Given an integer array, calculate the sum of its elements. You need to implement a function with the signature def simple_array_sum(arr: List[int]) -> int: where arr is the integer array. The function returns the sum of all elements in the array. Example input: [1, 2, 3, 4] Example output: 10. Assume the array length is at most $10^3$.
Example
Input
1
2
3
4