aboutsummaryrefslogtreecommitdiff
path: root/challenge-211/spadacciniweb/python
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-211/spadacciniweb/python')
-rw-r--r--challenge-211/spadacciniweb/python/ch-1.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/challenge-211/spadacciniweb/python/ch-1.py b/challenge-211/spadacciniweb/python/ch-1.py
index 00f663b9f1..985e105c76 100644
--- a/challenge-211/spadacciniweb/python/ch-1.py
+++ b/challenge-211/spadacciniweb/python/ch-1.py
@@ -23,11 +23,11 @@ import numpy
def check_toeplitz(matrix):
m = numpy.array(matrix)
- dim = min(m.shape)
- value = m[0][0]
- for i in range(dim):
- if m[i][i] != value:
- return 'false'
+ rows, cols = m.shape
+ for i in range(1,rows):
+ for j in range(1,cols):
+ if m[i][j] != m[i-1][j-1]:
+ return 'false'
return 'true'
if __name__ == "__main__":