Convert the given 2D array of numbers to an array of sums by replacing each nested array with its sum.
- Input will be a 2D array that has another array at each index.
- The inner array will contain numbers only.
- Calculate the sum of numbers in each nested array.
- Return an array that has the sum of elements of the nested array at the same index.
For example: