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