
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
If the subtree doesn't contain 1, then the missing value will always be 1.
What data structure allows us to dynamically update the values that are currently not present?