Sponsored
Use these hints if you're stuck. Try solving on your own first.
How would you solve the problem for offline queries (all queries given at once)?
Think about which data structure can help insert and delete the most optimal way.
Solve with full IDE support and test cases