Java. Arrays. Diagonal sum
\n\nclass Solution {\n    public int diagonalSum(int[][] mat) {\n        int i = 0;\n        int sum = 0;\n        while (i < mat.length)\n        {\n          
\n```\nclass Solution {\n    public int diagonalSum(int[][] mat) {\n        int i = 0;\n        int sum = 0;\n        while (i < mat.length)\n        {\n            sum += mat[i][i];\n            mat[i][i++] = 0;\n        }\n        i = 0;\n        while (i < mat.length)\n            sum += mat[i][mat.length - 1 - i++];\n        return sum;\n    }\n}\n```
['Java']