give square matrix mat return sum matrix diagonalsonly include sum element primary diagonal element secondary diagonal primary diagonal Example 1input mat 123 456 789output 25explanation diagonal sum 1 5 9 3 7 25notice element mat11 5 count onceExample 2input mat 1111 1111 1111 1111output 8example 3input mat 5output 5 Constraintsn matlength matilength1 n 1001 matij 100