length made only of the letters a, e, i, o, u. A word is sorted if every letter comes no earlier in the alphabet than the one before it (repeats are allowed).
Return the number of sorted words of length length.length=2 → 15
The words are aa, ae, ai, ao, au, ee, ei, eo, eu, ii, io, iu, oo, ou, uu: 15 in total. A word like "ia" does not count, since i comes after a.
length=1 → 5
Each of the five vowels on its own is a sorted word.
length=5 → 126
length=2
15
Run checks the first 3 tests in your browser. Submit checks all 27 tests on the server, hidden ones included.