Generate grid with highest possible peak from water/land
Filed under Snowflake
The question
Given a 2D boolean array representing water (true) and land (false), generate a grid where water height is 0 and adjacent land height differs by at most 1, achieving the highest possible peak.
No write-up yet. Related questions below have one.
Related Snowflake questions
Collected from public candidate posts and coding forums. Updated Nov 2026.