Problem 2313 · Medium
Each node keeps the cost of making it false and true; operators combine child pairs bottom-up.
Open the interactive visualisation