Problem context and objectives
Mission briefing
Expedition navigator · Safe camps and hazards form a connected world map
Find a valid route while marking every place already explored: Largest Island.
Without visited state, the party loops forever or revisits expensive terrain.
How you win
- 1Recognize when Maximum area of island matches the clues
- 2Keep this true after every move: area counts exactly the current flooded component and best is the largest completed component
- 3Reach the result within O(rows times columns) time and space
Rules and pressure
- Target cost: O(rows times columns) time and space
- State rule: area counts exactly the current flooded component and best is the largest completed component
Lesson 1 of 3
Reset local area to zero for every flood; update global best only after the component finishes.
Your call · After finishing an area-2 island, what area value starts the next island?