Problem 3812 · Hard

Minimum Edge Toggles on a Tree

Each toggle flips both endpoints of an edge. Working from the leaves up, an edge is used exactly when the node below it still differs from its target.

Open the interactive visualisation