We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2173de0 commit a3c249aCopy full SHA for a3c249a
scripts/algorithms/T/Toeplitz Matrix/Toeplitz Matrix.rs
@@ -0,0 +1,7 @@
1
+// Runtime: 0 ms (Top 100.0%) | Memory: 2.20 MB (Top 35.29%)
2
+
3
+impl Solution {
4
+ pub fn is_toeplitz_matrix(matrix: Vec<Vec<i32>>) -> bool {
5
+ matrix.windows(2).all(|w| w[0].iter().take(w[0].len() - 1).eq(w[1].iter().skip(1)))
6
+ }
7
+}
0 commit comments