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.
Flood-fill the component of the starting cell, then recolor only the component cells that touch the grid edge or a different value.