Error
|
|
---|---|
@Ibrahim Nash | 6381 |
@blackshadows | 6329 |
@mb1973 | 5388 |
@Quandray | 5231 |
@akhayrutdinov | 5111 |
@saiujwal13083 | 4510 |
@sanjay05 | 3762 |
@marius_valentin_dragoi | 3522 |
@sushant_a | 3459 |
@verma_ji | 3357 |
@KshamaGupta | 3318 |
Complete Leaderboard | |
|
|
@1905439 | 553 |
@terabaap123 | 508 |
@smitadiwedi1991 | 279 |
@DevanandJayakumar | 250 |
@atishagusain | 244 |
@gupta_10 | 226 |
@nipun edara | 224 |
@shubhamkhullar7 | 224 |
@sharmachandan487 | 204 |
@balunagar | 204 |
@arshjit_singh7 | 190 |
Complete Leaderboard |
Given a string return all unique 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.
NOTE: Return all the unique subsequences in lexicographically sorted order.
Example 1:
Input: S = "abc" Output: "ab", "ac", "abc" Explanation: "ab", "ac", "abc" are the all possible subsequences which start with vowel and end with consonant.
Example 2:
Input: S = "aab" Output: "ab", "aab" Explanation: "ab", "aab" are the all possible subsequences which start with vowel and end with consonant.
Your Task:
You dont need to read input or print anything. Complete the function allPossileSubsequences() which takes S as input parameter and returns all possible subsequences which start with vowel and end with consonant.
Expected Time Complexity: O(n*logn*2n)
Expected Auxiliary Space: O(2n)
Constraints:
1<= |S| <=18
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes