Given a string S and a string T, we have to count the number of distinct sub-sequences of T in S. Can anyone please explain the DP approach behind solving this problem. Here's one basic solution i found. I am unable to understand how the sub problem is chosen in this case.
↧