Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
What's the optimal way to delete characters if three or more consecutive characters are equal?
If three or more consecutive characters are equal, keep two of them and delete the rest.