Skip to content

Instantly share code, notes, and snippets.

@NicolaM94
Last active March 29, 2023 21:55
Show Gist options
  • Save NicolaM94/289633dfe6914a6bddc06255d83c7eeb to your computer and use it in GitHub Desktop.
Save NicolaM94/289633dfe6914a6bddc06255d83c7eeb to your computer and use it in GitHub Desktop.
Solution to the Toeplitz matrix checker
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