Simple || Single Loop || 90% Fast
\nclass Solution \n{\npublic:\n    int diagonalSum(vector<vector<int>>& mat)\n    {\n        int x = 0, y = 0, n = mat.size();\n        for(int i = 0 ; i < n ; 
````\nclass Solution \n{\npublic:\n    int diagonalSum(vector<vector<int>>& mat)\n    {\n        int x = 0, y = 0, n = mat.size();\n        for(int i = 0 ; i < n ; ++i )\n        {\n            x += mat[i][i];//Primary\n            y += mat[i][n - i - 1];//Secondary\n        }\n        if(n%2==0)\n            return x+y;\n        return x+y-mat[n/2][n/2];//Removes the central element as we have added it twice\n    }\n};\n````
['C', 'C++']