Problem 1034 · Medium

Coloring A Border

Flood-fill the component of the starting cell, then recolor only the component cells that touch the grid edge or a different value.

Open the interactive visualisation