Problem of the day
A Subsequence of a string is the one which is generated by deleting 0 or more letters from the string and keeping the rest of the letters in the same order.
The first line of input contains an integer ‘T’ denoting the number of test cases. Then T test cases follow.
The first and only line of each test case contains string 'STR'.
For each test case, print the subsequences of the string 'STR' separated by space.
The output of each test case is printed in a separate line.
The output strings can be returned in any order.
You don’t have to print anything, it has already been taken care of. Just implement the function.
1 <= T <= 10
1 <= |STR| <= 16
Where |STR| represents the length of the string 'STR'.
Time Limit: 1 sec
1
abc
a ab abc ac b bc c
All possible subsequences of abc are :
“a” , “b” , “c” , “ab” , “bc” , “ac”, “abc”
1
bbb
b b b bb bb bb bbb