We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 487d1fa commit 812a019Copy full SHA for 812a019
README.md
@@ -45,6 +45,8 @@ Step 2. Add the dependency
45
46
<summary>展开查看</summary>
47
48
+https://leetcode.cn/problems/toeplitz-matrix/
49
+
50
https://leetcode.cn/problems/transpose-matrix/
51
52
https://leetcode.cn/problems/divide-array-in-sets-of-k-consecutive-numbers
toeplitz-matrix/index.ts
@@ -0,0 +1,10 @@
1
+function isToeplitzMatrix(matrix: number[][]): boolean {
2
+ return matrix.every((a, i) =>
3
+ a.every((v, j) => {
4
+ if (typeof matrix[i + 1]?.[j + 1] === "undefined") return true;
5
6
+ return matrix[i + 1]?.[j + 1] === v;
7
+ })
8
+ );
9
+}
10
+export default isToeplitzMatrix;
0 commit comments