leetcode
1572. Matrix Diagonal Sum
Solution
Python code
Java code
Time complexity: O(n)
Space complexity: O(1)