Java || Easy to understand || O(n2)
\nclass Solution {\n    public int diagonalSum(int[][] mat) {\n        int sum = 0;\n        \n        for(int i=0; i<mat.length; i++){\n            for(int j=0
```\nclass Solution {\n    public int diagonalSum(int[][] mat) {\n        int sum = 0;\n        \n        for(int i=0; i<mat.length; i++){\n            for(int j=0; j<mat.length; j++){\n                if(i == j)\n                    sum +=mat[i][j];\n                \n                else if(i + j == mat.length - 1)\n                    sum += mat[i][j];\n            }\n        }\n        \n        return sum;\n    }\n}\n```
['Java']