Problem

Return a new int[] where each entry is the sum of the corresponding row in grid.

Examples

  • rowTotals([[1, 2], [3, 4]]) -> [3, 7]
  • rowTotals([[10], [1, 1]]) -> [10, 2]
Compile and test (Ctrl+Enter)