Sponsored
Use these hints if you're stuck. Try solving on your own first.
Problem is simpler to solve by working the string from back to front and using a map.
Solve with full IDE support and test cases