Given an m × n island where heights[i][j] is the elevation, water can flow to adjacent cells with equal or lower height.
The Pacific ocean touches the left and top edges. The Atlantic touches the right and bottom edges.
Find all cells where water can flow to both oceans.
With heights:
1 2 2 3 5
3 2 3 4 4
2 4 5 3 1
6 7 1 4 5
5 1 1 2 4
Cells that can reach both: (0,4), (1,3), (1,4), (2,2), (3,0), (3,1), (4,0).
Constraints: .