#417

Pacific Atlantic Water Flow

medium· Graphsruns: 0

There is an m x n rectangular island that borders both the Pacific Ocean (top and left edges) and the Atlantic Ocean (bottom and right edges). The island is partitioned into a grid where heights[r][c] gives the height of cell (r, c). Water flows from a cell to a 4-directionally adjacent cell with height less than or equal to the current cell. Return a list of grid coordinates where water can flow to both oceans.

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.