Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Try using tree DP to solve this problem.
Find the minimum operations to change each subtree to true and to false separately.
For nodes representing boolean operations, find the minimum operations by trying all combinations of values to which the child nodes can evaluate.