You are choosing the name for your company. You have several proposals, and you want to choose the easiest to remember. Thus you calculate a special remembering value for each word, and choose the word with the smallest remembering value.
You can calculate the remembering value of the word in two steps. First, you should find all maximal groups of consecutive vowels (if the word is "DoUble", "oU" and "e" are the two groups). Each such group adds 1 point to the remembering value. Second, you should find all maximal groups of consecutive consonants. Each such group adds (2*(Length of the group) - 1) points to the remembering value.
Given a list of all proposals, return the one with the smallest remembering value. In case of a tie, return the proposal which comes first in the input.
|