Sponsored
Use these hints if you're stuck. Try solving on your own first.
Try saving the first and last position of each character
Try finding every pair of indexes with equal characters
Solve with full IDE support and test cases