Problem 1273 · Medium

Delete Tree Nodes

Delete every subtree whose total value is zero, then count the nodes that remain in the tree.

Open the interactive visualisation