easy explanation,O(N)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\no(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int diagonalSum(vector<vector<int>>& mat) {\n        int n = mat.size () ;\n        int mid = n/2 ;\n\n        int sum = 0 ;\n        for(int i = 0 ; i<n ; i++){\n            sum+= mat[i][i] ;\n            sum+= mat[i][n-1-i] ;\n        }\n\n        if(n&1 == 1) sum-= mat[mid][mid] ; //checking if the size of the matrix is odd or even \n        return sum ;\n    }\n};\n```
['C++']