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.
In worst case O(n*l);
n is str length.
l is "aeiouAEIOU" length.
Am I misstaking?
Hey, thanks for the feedback.
While you are correct consider that there was no expected behaviour specified, e.g. should we return null oder string.Empty, which is the reason for me letting the method raise an exception in the case of the parameter being null.
I agree whit BNoohi. But your (BNoohi) solution is not the best to if youl pass something like "2 4 10 8 7" your solution wil trow an out of range exception :)
This solution will fail if the argument (cc) == null => Calling Length property will throw a "System.NullReferenceException: 'Object reference not set to an instance of an object.'"
Nice way around the arbitrary comma rule...
You're right, the contains just raised a flag but the string is constant.
This comment is hidden because it contains spoiler information about the solution
Clever but not a best practice. This solution is inefficient as the growth is O(n^2).
You can reduce the memory footprint by replacing evenCount and oddCount with booleans set to true on the first occurance and exit on second if true. You would be replacing two ints with booleans.
Clever but not a best practice. This solution is inefficient as the growth is O(n^2).
This comment is hidden because it contains spoiler information about the solution