Sponsored
Use these hints if you're stuck. Try solving on your own first.
Traverse the tree using depth-first search in post-order.
Can you use recursion to solve this easily?
Solve with full IDE support and test cases