반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 다비드상
- 코딩
- Python
- 재택근무
- 웹개발
- 취미
- 파이썬
- 색연필
- react
- csts
- 연필
- 알고리즘
- 프로그래밍
- IT자격증
- 연필소묘
- 소묘
- 코드잇
- 미켈란젤로
- 코딩테스트
- IT 자격증
- 프로그래머스
- 테스팅 자격증
- PrivateRouter
- 그림
- KSTQB
- leetcode
- 토익 환급
- clean code
- Kriss 재택
- 클린 코드
Archives
- Today
- Total
목록dfs (1)
글모음
[Leetcode] 733. Flood Fill [Easy, Python]
기준점 상하좌우 탐색해서 같다면 newColor 값으로 바꿔주는 DFS 문제 [ 코드 1. 실패 ] def floodFill(self, image, sr, sc, newColor): limit_x = list(range(len(image)+1)) limit_y = list(range(len(image[0]))) l_color = image[sr][sc] def dfs(x, y): positions = [[x, y-1], [x, y+1], [x-1, y], [x+1, y]] if x in limit_x and y in limit_y: if image[x][y] == l_color: image[x][y] = newColor for i in range(len(positions)): if positions[i]..
알고리즘/Leetcode
2021. 6. 15. 13:36