Objective
Write a function that fills an output array with the sum of each row of a 2D grid whose rows are exactly four integers wide.
Steps
$ int grid[2][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}}; row_sums(grid, 2, out);
10 26
$ int grid[3][4] = {{1, 2, 3, 4}, {10, 20, 30, 40}, {100, 200, 300, 400}}; row_sums(grid, 3, out);
10 100 1000
$ int out[3] = {-1, -1, -1}; row_sums(grid, 0, out);
-1 -1 -1
Expected files
Allowed functions
None. Write every helper yourself.
Allowed headers

Objective
Write a function that fills an output array with the sum of each row of a 2D grid whose rows are exactly four integers wide.
Steps
$ int grid[2][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}}; row_sums(grid, 2, out);
10 26
$ int grid[3][4] = {{1, 2, 3, 4}, {10, 20, 30, 40}, {100, 200, 300, 400}}; row_sums(grid, 3, out);
10 100 1000
$ int out[3] = {-1, -1, -1}; row_sums(grid, 0, out);
-1 -1 -1
Expected files
Allowed functions
None. Write every helper yourself.
Allowed headers

Tests
Run the tests to grade your code