Given a 2D matrix of integers matrix, return the sum of all elements.
Iterate through every row and column to accumulate the total.
matrix = [[1,2],[3,4]]10matrix = [[1,2,3],[4,5,6],[7,8,9]]45matrix = [[-1,2],[-3,4]]21 <= matrix.length, matrix[i].length <= 100-1000 <= matrix[i][j] <= 1000Run your code to see results
Use Cmd+Enter to run