Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use a stack to process everything greedily.
Solve with full IDE support and test cases