Search
⌘K
Get Premium
Leetcode 417. Pacific Atlantic Water Flow
Given an m×n height grid where water can flow from a cell to any neighbor of lesser-or-equal height, return all coordinates from which water can reach both the Pacific (top/left edges) and Atlantic (bottom/right edges). The core challenge is a graph/grid reachability problem typically solved by two multi-source traversals (BFS/DFS) from the ocean borders, propagating uphill (to equal-or-higher heights) and intersecting the reachable sets.
Asked at:
Meta
M
Merge
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early April, 2025
M
Merge
Senior
Late November, 2024
Meta
Junior
Solve a variation of Pacific Atlantic Water Flow without oceans
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.