Pacific Atlantic Water Flow
Medium
Graphs
An R x C grid gives cell heights. Water flows to neighbouring cells with equal or lower height. The Pacific touches the top and left edges, the Atlantic the bottom and right edges. Print the number of cells from which water can reach both oceans.
Constraints
1 <= R, C <= 200 0 <= height <= 10^5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.