BETA

Difficulty Level: Basic

Submissions: 467 Accuracy:

15.42%

String Subsequence Game
       

Given a string return all possible subsequences which start with vowel and end with consonant. A String is a subsequence of a given String, that is generated by deleting some character of a given string without changing its order.
Examples:

Input : 'abc'
Output : ab, ac, abc

Input : 'aab'
Output : ab, aab

Input:
First line consists of T test cases. Only line of every test case consists of String S.

Output:
Single line output, print all the subsequences in lexicographically sorted, if no subsequence found than print -1.

Constraints:
1<=T<=100
1<=|String length|<=100

Example:
Input:

2
xabcef
abc
Output:
ab abc abcef abcf abef abf ac acef acf aef af ef 
ab abc ac 

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

Contributor: Saksham Raj Seth

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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