← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given an m x n matrix, return true if the matrix is Toeplitz. Otherwise, return false.
A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element. In other words, for every cell matrix[i][j] (where i > 0 and j > 0), it must equal matrix[i-1][j-1].
You need to implement a function that checks this property efficiently.