Verify that every diagonal from top-left to bottom-right holds the same value throughout a 2D grid.
Constraints
Example
>>> is_toeplitz([[1,2,3,4], [5,1,2,3], [9,5,1,2]]) True >>> is_toeplitz([[1,2], [2,2]]) False >>> is_toeplitz([[42]]) True
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints