getting wrong answer in 4 testcases. pls tell the correct code.
Count subsequences
@yutikakhanna
a) In the question we are asked only number of ways so no need to generate all subsequence because time complexity is high for this solution
b) refer method 2 of this article to understand the approach -> https://www.geeksforgeeks.org/count-distinct-subsequences/
c)solution -> https://ide.codingblocks.com/s/208159
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.