Loading...
Given an m x n matrix of heights, water flows from a cell to adjacent cells with height <= current height. The Pacific ocean touches the left and top edges. The Atlantic ocean touches the right and bottom edges.
Return cells where water can flow to both oceans. Output each cell as "row col" on a separate line, sorted by row then column.
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
0 4 1 3 1 4 2 2 3 0 3 1 4 0