The code is running ,but the 2 test cases are not being passed.
Here is the link of the code given below.
Doubt in Recursion Subsequences
@ratulhans
Could you please share the problem link as well.
The two I could find were these -
And none of them fit your code really. If it is one of them , let me know or please give me the exact name of the HackerBlocks link to your problem.
@ratulhans
As you can see , your order of output is reversed. In order to reverse your current output , change the order of the recursive calls.
Instead of your current order , make it like this
subsequences(input,output,i+1,j);
output[j]=input[i];
subsequences(input,output,i+1,j+1);
Also you are required to print the number of subsequences. This number is equal to 2^n where n is the length of your input string.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.