Last active
March 29, 2023 21:55
-
-
Save NicolaM94/289633dfe6914a6bddc06255d83c7eeb to your computer and use it in GitHub Desktop.
Solution to the Toeplitz matrix checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ToeplitzCheck(matrix): | |
crntRow = 0 | |
maxRow = len(matrix) | |
while crntRow < maxRow -1 : | |
if matrix[crntRow][0:len(matrix)-1] != matrix[crntRow+1][1:len(matrix)]: | |
return False | |
crntRow += 1 | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment