Fade to Solo
Graphs (BFS/DFS)

Pacific Atlantic Water Flow

30 MINMleetcode ↗

Problem

You have a grid of heights. The Pacific touches the top and left edges, the Atlantic touches the bottom and right edges. Water flows from a cell to a neighbor only if the neighbor's height is less than or equal to the current cell's. Return every cell from which water can reach both oceans.

30 MIN00:00unlocks in 30:00
locked30:00 left