From bb2cf0104d8ae09e93b8ab7621b8c400640311e3 Mon Sep 17 00:00:00 2001 From: Mariano Spadaccini Date: Tue, 11 Apr 2023 16:08:23 +0200 Subject: PWC-212 (and PWC-211 fix) --- challenge-211/spadacciniweb/python/ch-1.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'challenge-211/spadacciniweb/python') 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__": -- cgit