Sandwiched_Vowels
Submissions: 954   Accuracy:

38.73%

  Difficulty: Basic   Marks: 1

For a given string S, comprising of only lowercase English alphabets, eliminate the vowels from the string that occur between two consonants(sandwiched between two immediately adjacent consonants). Print the updated string on a new line.

Input:

First line of input is an integer T, denoting the number of test cases. For each test case, input the string S on a new line.

Output:

For each test case, the only line of output is the updated string after omission of all sandwiched vowels.

Constraints:

1<=T<=100

3<=L<=10, where L is length of string S

'a'<=S[i]<='z', i is an integer denoting index of S


Example:

Input:

5
bab
ceghij
aaii
gghho
saaafor

Output:

bb
cghj
aaii
gghho
saaafr

Explanation:

In the first test case, a is a vowel occuring between two consonants i.e. b. Hence the updated string eliminates a.
In the second test case, e and i are the vowels occurring between tow consonants. Hence they are removed from the string.
In the third and fourth test cases, there is no such vowel that occurs between two consonants. Hence the string remains unchanged.
In the fifth test case, o occurs between f and r which are consonants, hence is eliminated.

 

** For More Input/Output Examples Use 'Expected Output' option **

Author: Anushree_20


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.