Find the sum of elements in a given integer array
Find the sum of elements in a given integer array.
Sample Code:
function sum(s) {
// Enter your logic here...
}
Examples:
Input: [1,2,3,4,5]
Output: 15
Explanation: 1 + 2 + 3 + 4 + 5 = 15
Input: [-10, 10, 1, -1, 100]
Output: 100
Explanation: -10 + 10 + 1 - 1 + 100 = 100