Runtime: 0 ms, faster than 100.00%, Java clean code
\nclass Solution {\n    public int diagonalSum(int[][] mat) {\n        int min = 0, max = mat.length-1, sum = 0;\n        while (min < max) {\n            sum +
```\nclass Solution {\n    public int diagonalSum(int[][] mat) {\n        int min = 0, max = mat.length-1, sum = 0;\n        while (min < max) {\n            sum += mat[min][min] + mat[min][max] + mat[max][min] + mat[max][max];\n            min++; max--;\n        }\n        return min == max ? sum + mat[min][min] : sum;\n    }\n}\n```
[]