Row Sums of a Matrix
EasyP3Coding
Return the sum of each row of a square matrix, from the first row to the last.
Example 1
- Input
- matrix = [[1,2,3],[4,5,6],[7,8,9]]
- Output
- [6,15,24]
Example 2
- Input
- matrix = [[5]]
- Output
- [5]
Example 3
- Input
- matrix = [[1,2],[3,4]]
- Output
- [3,7]
Constraints
- 1 <= N <= 100
- -10^4 <= matrix[i][j] <= 10^4
Hints
Give it a real attempt first. Run shows which examples fail.
Saved automatically
Run checks the 3 visible tests, Submit all 10. ⌘Enter runs, ⌘⇧Enter submits.