Index of the first occurrence of ch in strr
j = nextOccurrence ( strr , n , 0 , ch ) NEW_LINE for i in range ( n ) : NEW_LINE INDENT while ( j != - 1 and j < i ) : NEW_LINE INDENT j = nextOccurrence ( strr , n , j + 1 , ch ) NEW_LINE DEDENT DEDENT