Company: Microsoft intern
Difficulty: medium
Well-Structured Words A couple of friends decided to play an anagram-finding word game. The point of the game is to find all the anagrams of a given word. Unfortunately, the friends are not fluent in English, so, instead of finding all the English words, they decided to look for all the well-structured words. We say that a word is well-structured if it: starts with a consonant; does not contain two consecutive vowels; does not contain two consecutive consonants. Assume that the letters AEIOU are vowels, and that all other letters are always consonants. Please note, that Y is treated as a consonant. Well-Structured Words Examples PUTOR RUME TABEK BABABAB BABABA YAMAR Non-Well-Structured Words Examples ABAR (does not start with a consonant) BAAR (contains two consecutive vowels) KAKKE (contains two consecutive consonants) AARO (does not start with a consonant, and contains two consecutive vowels) BOARD (contains two consecutive vowels and two consecutive consonants) Task Count the number