Sponsored
Use these hints if you're stuck. Try solving on your own first.
For each subtree, find the minimum value and maximum value of its descendants.
Solve with full IDE support and test cases