O(n) - Short & concise
\nclass Solution {\n    public int diagonalSum(int[][] mat) {\n        int sum =0, n = mat.length;;\n        for(int i=0; i<n; i++){\n            sum += mat[i][
```\nclass Solution {\n    public int diagonalSum(int[][] mat) {\n        int sum =0, n = mat.length;;\n        for(int i=0; i<n; i++){\n            sum += mat[i][i] + mat[i][n-1-i];\n        }\n        return (n&1) == 1 ? sum - mat[n/2][n/2] : sum;\n    }\n}\n```
[]