Skip to content

Commit 14216ab

Browse files
committed
chore: comment
1 parent fb062b0 commit 14216ab

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

spiral-matrix/jeldo.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
class Solution:
2+
# O(m*n), m = len(row), n = len(column)
23
def spiralOrder(self, m: list[list[int]]) -> list[int]:
34
dirs = [(0, 1), (1, 0), (0, -1), (-1, 0)]
45
result = []
@@ -15,12 +16,3 @@ def spiralOrder(self, m: list[list[int]]) -> list[int]:
1516
next_r, next_c = r + dirs[heading][0], c + dirs[heading][1]
1617
r, c = next_r, next_c
1718
return result
18-
19-
20-
cases = [
21-
[[1, 2, 3], [4, 5, 6], [7, 8, 9]],
22-
[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]],
23-
]
24-
25-
for c in cases:
26-
print(Solution().spiralOrder(c))

0 commit comments

Comments
 (0)