Store the indices which contains the vowels
indices = [ ] NEW_LINE for i in range ( n ) : NEW_LINE INDENT if ( s [ i ] == ' a ' or s [ i ] == ' e ' or s [ i ] == ' o ' or s [ i ] == ' i ' or s [ i ] == ' u ' ) : NEW_LINE INDENT counts [ s [ i ] ] += 1 NEW_LINE indices . append ( i ) NEW_LINE DEDENT DEDENT