Problem 2445 · Medium

Number of Nodes With Value One

Mark each queried node once; a node's value is the parity of marks on itself and its ancestors, found in one top-down pass.

Open the interactive visualisation