String Subsequence Game
Submissions: 938   Accuracy:

20.79%

  Difficulty: Basic   Marks: 1

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
Author: saksham seth


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.