Best Solution by java in Runtime 0ms and Beats 100%
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)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int diagonalSum(int[][] mat) {\n        int output = 0;\n        int j = mat.length;\n\n        for ( int i = 0; i < mat.length; i++) {\n            output += mat[i][i];\n            output += mat[i][j-1-i];\n        }\n\n        output -= (j % 2 !=0)? mat[j/2][j/2] : 0;\n\n\n        return output;\n    }\n}\n```\n\n\n## For additional problem-solving solutions, you can explore my repository on GitHub: [GitHub Repository](https://github.com/ahmedna126/java_leetcode_challenges)\n\n\n![e78315ef-8a9d-492b-9908-e3917f23eb31_1674946036.087042.jpeg](https://assets.leetcode.com/users/images/2f007d42-adf7-4a05-a8a0-519eabc0a64c_1683556673.544262.jpeg)\n
['Java']