diff options
| author | Mariano Spadaccini <spadacciniweb@gmail.com> | 2023-04-11 16:08:23 +0200 |
|---|---|---|
| committer | Mariano Spadaccini <spadacciniweb@gmail.com> | 2023-04-11 16:08:23 +0200 |
| commit | bb2cf0104d8ae09e93b8ab7621b8c400640311e3 (patch) | |
| tree | 954cca1c21fdc07f58af2afa2ae70d224f1b360c /challenge-211/spadacciniweb/python/ch-1.py | |
| parent | e5e6913d2faf5607a52ceb96efaa35c7b6ce57d3 (diff) | |
| download | perlweeklychallenge-club-bb2cf0104d8ae09e93b8ab7621b8c400640311e3.tar.gz perlweeklychallenge-club-bb2cf0104d8ae09e93b8ab7621b8c400640311e3.tar.bz2 perlweeklychallenge-club-bb2cf0104d8ae09e93b8ab7621b8c400640311e3.zip | |
PWC-212 (and PWC-211 fix)
Diffstat (limited to 'challenge-211/spadacciniweb/python/ch-1.py')
| -rw-r--r-- | challenge-211/spadacciniweb/python/ch-1.py | 10 |
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__": |
