We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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).
Day 2: Loops
You are viewing a single comment's thread. Return to all 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).