Problem 2399 · Easy

Check Distances Between Same Letters

Remember the first index of each letter, then compare the gap at its second occurrence with the given distance.

Open the interactive visualisation