Editorial for TLE '16 Contest 5 P1 - English Proficiency Exam


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Author: ZQFMGB12

First, we need to separate the words by spaces.

Next, note that if we have a permutation of a word, we can get to any other permutation of the same word by swapping adjacent characters.

Therefore, the only condition we need to check is if the difference between number of consonants and vowels is no greater than one, and if the word is 1 character long, that it is a vowel.

Time Complexity: \mathcal{O}(N)


Comments

There are no comments at the moment.