Sponsored
Use these hints if you're stuck. Try solving on your own first.
Create an integer array of size 26 to keep track of the first occurrence of each letter.
The number of letters between indices i and j is j - i - 1.
Solve with full IDE support and test cases