Sponsored
Use these hints if you're stuck. Try solving on your own first.
Run a simulation to follow the requirement of each query.
Solve with full IDE support and test cases