#31 - Matrix Diagonal Sum
You are given a square matrix mat
of size n x n
. Your task is to calculate the sum of the integers on both diagonals of the matrix.
Example 1
Input
Output
Example 2
Input
Output
Last updated