Back to all patterns

DFS/BFS (Reverse)

1 problems • Practice on LeetCode to earn credits

About This Pattern

Master the DFS/BFS (Reverse) pattern by practicing these problems organized by difficulty.Focus on the Key Signals - these are the indicators that tell you when to use this pattern.

Medium (1)

Pacific Atlantic Water Flow

Find cells where water can reach both Pacific and Atlantic oceans.

Key Signals:

Work backwards from oceansTwo separate DFSFind intersection