Simple java Solution || Matrix Diagonal Sum
\n\n# Code\n\nclass Solution {\n    public int diagonalSum(int[][] mat) {\n        int sum =0;\n        for(int i=0;i<mat.length;i++){\n            for(int j=0;
\n\n# Code\n```\nclass Solution {\n    public int diagonalSum(int[][] mat) {\n        int sum =0;\n        for(int i=0;i<mat.length;i++){\n            for(int j=0;j<mat[i].length;j++){\n                if(i==j || i+j==mat.length-1){\n                    sum = sum + mat[i][j];\n                }\n            }\n        }\n        return sum;\n    }\n}\n```
['Array', 'Matrix', 'Java']