Islands

From programming_contest
Revision as of 05:11, 2 November 2017 by imported>Kmk21
Jump to navigation Jump to search

Given a map, with marked land, water, and ???, determine the minimum number of disjoint pieces of land.

Quite a simple flood fill. When you find a piece of land, flood fill everything around it, including clouds, assuming they are land, and count 1 island.

All other clouds (which don't touch land) are considered water. [[Category:Ser2016