Pacific Atlantic Water Flow — Graphs: BFS/DFS

List every cell of a hilly terrain grid whose rain can run downhill to both edge reservoirs, flowing only to equal or lower neighbours.

Graphs: BFS/DFS · Medium

More in Graphs: BFS/DFS

All algorithm problems