Sponsored
Use these hints if you're stuck. Try solving on your own first.
Traverse the tree to find the max depth.
Traverse the tree again to compute the sum required.
Solve with full IDE support and test cases