diff options
| author | 冯昶 <fengchang@novel-supertv.com> | 2023-04-17 16:06:26 +0800 |
|---|---|---|
| committer | 冯昶 <fengchang@novel-supertv.com> | 2023-04-17 16:06:26 +0800 |
| commit | 64b7c608210e55b5564fe44df68d1eacf6d25969 (patch) | |
| tree | 685237e70e0a1f8d26440eec4d831853acb2c1c3 /challenge-211/spadacciniweb/python/ch-1.py | |
| parent | e2c8b4bec3b682df8597f57ec627508a07582d31 (diff) | |
| parent | 42228ce601fe37769faacc051f35f74b9566bb26 (diff) | |
| download | perlweeklychallenge-club-64b7c608210e55b5564fe44df68d1eacf6d25969.tar.gz perlweeklychallenge-club-64b7c608210e55b5564fe44df68d1eacf6d25969.tar.bz2 perlweeklychallenge-club-64b7c608210e55b5564fe44df68d1eacf6d25969.zip | |
Merge remote-tracking branch 'upstream/master'
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__": |
