leetcode

1572. Matrix Diagonal Sum

Solution

Time complexity: O(n)

Space complexity: O(1)