The code is running fine for the given input ab but while submitting on hacker blocks, the test case is not being passed.
Question
RECURSION - ALL SUBSEQUENCES
Print all the subsequences of a string in lexicographical order.
Input Format:
First line contains an integer N, the no of strings.
Next, N lines follows one string per line.
Constraints:
1 < len(str) < 20
Output Format:
No of subsequences one per line
Sample Input:
1
ab
Sample Output:
a
ab
b
Explanation:
4 subsequences are printed.
Empty string is a subsequence.
Code https://ide.codingblocks.com/s/116064