โ† CarWale questions
CodingModerate

Index gap between two occurrences of 'programmer' in a string

Filed under CarWale

The question

A string contains the word 'programmer' twice (letters possibly in different order); return the difference between the indices of the two substrings, or -1 if absent.

No write-up yet. Related questions below have one.

Related CarWale questions

Collected from public candidate posts and coding forums. Updated Nov 2026.