Practice Interview Questions
| Question | Status |
|---|---|
You are given an array of integers. Your task is to write a function sum_of_array that returns the sum of all the elements in the array.
Example:
Input: [1, 2, 3, 4]
Output: 10
Input: [-1, -2, -3, -4]
Output: -10