When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!
If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer!
If you keep your formatting consistent it’ll be easier to see what’s going on, you’ve got newlines in odd places and pushed together things into the same line that really don’t need to be on the same line.
inputIndex could be named i so that it doesn’t dominate your vision being mentioned everywhere
you can also make it easier for yourself if you do the filtering of vowels/nonvowels and the mapping of e/u separately from each other eg
here's my input
keep only the vowels
change e to ee
change u to uu
^ that can be a sequence of separate actions, doesn’t need to be all nested within one another in the same place