Problem 814 · Medium
Post-order DFS removes every subtree that contains no 1.
Open the interactive visualisation