You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: solution/0700-0799/0766.Toeplitz Matrix/README_EN.md
+46-9
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,11 @@ The diagonal "[1, 2]" has different elements.
66
66
67
67
<!-- solution:start -->
68
68
69
-
### Solution 1
69
+
### Solution 1: Single Traversal
70
+
71
+
According to the problem description, the characteristic of a Toeplitz matrix is that each element is equal to the element in its upper left corner. Therefore, we only need to iterate through each element in the matrix and check if it is equal to the element in its upper left corner.
72
+
73
+
The time complexity is $O(m \times n)$, where $m$ and $n$ are the number of rows and columns of the matrix, respectively. The space complexity is $O(1)$.
70
74
71
75
<!-- tabs:start -->
72
76
@@ -76,11 +80,11 @@ The diagonal "[1, 2]" has different elements.
0 commit comments