Search
⌘K

Leetcode 1034. Coloring A Border

Find the connected component containing grid[row][col] (4-directionally adjacent cells with the same color) and recolor only its border cells—those on the grid edge or adjacent to a cell not in the component—typically found via a DFS/BFS flood-fill.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.