Approach hintTry it first, then revealHide
A lake is a 4-connected group of cells with positive depth. Flood fill from each unvisited such cell, summing the depths of its component, and report the largest sum.
A lake is a 4-connected group of cells with positive depth. Flood fill from each unvisited such cell, summing the depths of its component, and report the largest sum.