Solution: Pacific Atlantic Water Flow
Let's solve the Pacific Atlantic Water Flow problem using the Graphs pattern.
Statement
Imagine an island with a rectangular shape that touches both the Pacific and Atlantic oceans. The northern and western sides meet the Pacific, while the southern and eastern sides touch the Atlantic. This island is divided into square cells.
To depict the height above sea level of each cell, we use an integer matrix, heights, of size ...