For Python, at least, you need more random cases for length == 4. This solution
cannot handle such case, but still passes the random tests, given enough tries.
For simplicity, treat the input as case-insensitive, but return the original casing of the word.
How is this the simplest version of the problem? You just doubled the number of vowels.
If you think adding case insensitivity to a regex is the simplest solution, please consider those that would not solve this with a regex.
I don't mind the spec so much, but please lose the "for simplicity". Alternatively, specify all lowercase inputs. That would not be a bad option for an estimated 7kyu.
For Python, at least, you need more random cases for
length == 4
.This solution
cannot handle such case, but still passes the random tests, given enough tries.
How is this the simplest version of the problem? You just doubled the number of vowels.
If you think adding case insensitivity to a regex is the simplest solution, please consider those that would not solve this with a regex.
I don't mind the spec so much, but please lose the "for simplicity". Alternatively, specify all lowercase inputs. That would not be a bad option for an estimated
7kyu
.