2399. Minimum Flips in Binary Tree to Get Result

Hard
Dynamic Programming
Tree
Depth-First Search
Binary Tree

Description

Hints

Hint 1
Try using tree DP to solve this problem.
Hint 2
Find the minimum operations to change each subtree to true and to false separately.
Hint 3
For nodes representing boolean operations, find the minimum operations by trying all combinations of values to which the child nodes can evaluate.

Statistics

Acceptance
56.8%
Submissions
8,868
Accepted
5,039