• + 7 comments

    You're looping through the input string twice, doing the same thing, which breaks a very important rule in programming - DRY (don't repeat yourself). My advice is to try to produce a respone by looping only once through s, which will require vowels to be presented in more efficient way (the problem does not state they have to be stored in an array).