Problem 2368 · Medium

Reachable Nodes With Restrictions

Search outward from node 0 in a tree, never stepping onto a restricted node, and count the nodes that are reached.

Open the interactive visualisation