# Vowel Anxiety CodeChef Solution

Table of Contents

### We Are Discuss About CODECHEF SOLUTION

Vowel Anxiety solution codechef

## Vowel Anxiety CodeChef Solution

His teacher gave him the following problem to improve his vowel-identification skills:

There is a string SS of length NN consisting of lowercase English letters only. Utkarsh has to start from the first letter of the string.
Each time he encounters a vowel (i.e. a character from the set {a,e,i,o,u}{a,e,i,o,u}) he has to reverse the entire substring that came before the vowel.

Utkarsh needs help verifying his answer. Can you print the final string after performing all the operations for him?

### Input Format

• First line will contain TT, number of test cases. Then TT test cases follow.
• The first line of each test case contains NN, the length of the string.
• The second line contains SS, the string itself.

### Output Format

For each test case, output in a single line the final string after traversing SS from left to right and performing the necessary reversals.

## Vowel Anxiety CodeChef Solution

• 1T1041≤T≤104
• 1N1061≤N≤106
• Sum of NN over all test cases does not exceed 106106.

### Sample Input 1

2
10
abcdefghij
7
bcadage


### Sample Output 1

hgfeabcdij
gacbade


## Vowel Anxiety CodeChef Solution

Test case 11: The first letter is a vowel, but there is no substring before it to reverse, so we leave it as it is. Next, we reverse abcd and the string becomes dcbaefghij. Next we reach the vowel i and reverse dcbaefgh to get the string hgfeabcdij.

Test case 22: Initially, we reverse bc and the string becomes cbadage. Next we reach the vowel a and reverse cbad to get the string dabcage. Finally we reach the vowel e and reverse dabcag to get the string gacbade.

## SOLUTION

Yhaa You have done it but next? if YOU Want to Get Others Please Visit Here ScishowEngineer   Then Follow US HERE and Join Telegram.

If You Want To Learn Something New Then Visit Our Official Channel YOUTUBE