Skip to content

Commit 76f5c08

Browse files
Small fix
1 parent fc50dd4 commit 76f5c08

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/flood_fill.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@
33
44
https://leetcode.com/problems/flood-fill
55
6-
Example:
7-
8-
j →
9-
i
10-
↓ 1 1 1 2 2 2
11-
1 1 0 → 2 2 0
12-
1 0 1 2 0 1
6+
NOTES
7+
* Use breadth-first search.
138
149
This problem is very straight-forward if you use breadth-first search. Simply
1510
add adjacent pixels that share the same color as the starting pixel to the
@@ -45,6 +40,14 @@
4540
4641
This solution has O(n) time complexity and O(n) space complexity, since, in the
4742
worst case, we will need to visit every pixel in the image.
43+
44+
Example:
45+
46+
j →
47+
i
48+
↓ 1 1 1 2 2 2
49+
1 1 0 → 2 2 0
50+
1 0 1 2 0 1
4851
"""
4952

5053
from collections import deque

0 commit comments

Comments
 (0)