Rain falling on a cell of a heightmap keeps flowing to a lower neighbour until it can go no lower. For every cell, find where its water stops.
Rain falling on a cell of a heightmap keeps flowing to a lower neighbour until it can go no lower. For every cell, find where its water stops.
Opens with the full question.