K. Stepan and Vowels

Codeforces
IDCF774K
Time1000ms
Memory256MB
Difficulty
implementationstrings
Stepan likes to repeat vowel letters when he writes words. For example, instead of the word "_pobeda_" he can write "_pobeeeedaaaaa_". Sergey does not like such behavior, so he wants to write a program to format the words written by Stepan. This program must combine all consecutive equal vowels to a single vowel. The vowel letters are "_a_", "_e_", "_i_", "_o_", "_u_" and "_y_". There are exceptions: if letters "_e_" or "_o_" repeat in a row exactly 2 times, like in words "_feet_" and "_foot_", the program must skip them and do not transform in one vowel. For example, the word "_iiiimpleeemeentatiioon_" must be converted to the word "_implemeentatioon_". Sergey is very busy and asks you to help him and write the required program. ## Input The first line contains the integer _n_ (1 ≤ _n_ ≤ 100 000) — the number of letters in the word written by Stepan. The second line contains the string _s_ which has length that equals to _n_ and contains only lowercase English letters — the word written by Stepan. ## Output Print the single string — the word written by Stepan converted according to the rules described in the statement. [samples]
Samples
Input #1
13
pobeeeedaaaaa
Output #1
pobeda
Input #2
22
iiiimpleeemeentatiioon
Output #2
implemeentatioon
Input #3
18
aeiouyaaeeiioouuyy
Output #3
aeiouyaeeioouy
Input #4
24
aaaoooiiiuuuyyyeeeggghhh
Output #4
aoiuyeggghhh
API Response (JSON)
{
  "problem": {
    "name": "K. Stepan and Vowels",
    "description": {
      "content": "Stepan likes to repeat vowel letters when he writes words. For example, instead of the word \"_pobeda_\" he can write \"_pobeeeedaaaaa_\". Sergey does not like such behavior, so he wants to write a progr",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF774K"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Stepan likes to repeat vowel letters when he writes words. For example, instead of the word \"_pobeda_\" he can write \"_pobeeeedaaaaa_\".\n\nSergey does not like such behavior, so he wants to write a progr...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments