Skip to content

Commit a3c249a

Browse files
committed
Runtime: 0 ms (Top 100.0%) | Memory: 2.20 MB (Top 35.29%)
1 parent 2173de0 commit a3c249a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)