i have done this problem using Prateek bhaiya’s approach but did not understand how to implement the approach from hint ,can you please explain it to me?
I want a better solution
hey @Ayusinha, Logic is to iterate over the string and do two steps, include the current char and not include the current char.
I will suggest you to dry run the code on your own with the help of this pic.
I hope you know the code. If not, check backtracking section of your code.
There is one more way of generating subsequence but that is using bitmasking. When you are comfortable with Bitmasking basics. Watch this video after 1hr 3mins https://www.youtube.com/watch?v=wEZfc6cPC4w
