#29 - Sum of Elements in Matrix

Problem Statement:

You are given a matrix of size m x n, where each cell contains an integer value. Your task is to implement a function to calculate the sum of all elements in the matrix.

Example 1

Input

matrix = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
]

Output

45

Last updated