Problem 1254 · Medium

Number of Closed Islands

Count groups of zero cells that are fully enclosed by one cells and do not touch the grid border. The visual floods the border-connected zeros first, then counts the enclosed islands that remain.

Open the interactive visualisation