Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
Thank you for taking my feedback very positively @Rochieoreo :-)
Thank you, ill use that in further development. :)
I must admit, I should have used lambda for this question. I was doing a brute force first and I just submitted the answer too quick. But I see a lot of answers here that I think are great and much better than my answer!
Check @superklamer solutin, There is no need for "break" on each case! It all can be nest like the switch statement above. However, read my comment, I do like that approach
switch(strArray[incriment])
{
case 'e':
case 'a':
case 'i':
case 'o':
case 'u':
vowelCount++;
break;
default:
break;
}
I must admit that that this is one of the ways I wanted to solve this problem. If we put efficiency aside, this a cleaner and ready to read approach in bigger system. I know the the Vowels are not changing, but for things that are going to chance in the future and you want to maintain clean and readable code. I'd do it that way
Unless I am missing something, the problem with this approach that it is assuming that the string is coming in in all lower case. Upper, or mix case will fail.
Nice!