Skip to content

Commit da62e13

Browse files
committed
set-matrix-zeroes solution
1 parent f73c2ce commit da62e13

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

set-matrix-zeroes/yyyyyyyyyKim.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ def setZeroes(self, matrix: List[List[int]]) -> None:
44
Do not return anything, modify matrix in-place instead.
55
"""
66
# 0이 있는 행, 열을 기록해두고 그 기록을 토대로 바꾸기(시간복잡도 O(m*n), 공간복잡도 O(m+n))
7+
# Follow up : 공간복잡도 O(1) 생각해볼것
78
m, n = len(matrix), len(matrix[0])
89
# rows, cols = [] , [] -> 중복되어 들어갈 수 있음. 불필요함. 중복제거를 위해 set 사용.
910
rows, cols = set(), set()

0 commit comments

Comments
 (0)