Problem 1042 · Medium

Flower Planting With No Adjacent

Give each garden the smallest flower type its planted neighbours have not used; each garden has at most three paths, so four types always suffice.

Open the interactive visualisation