Solve Distinct Subsequences from LeetCode. Given strings and , count distinct subsequences of that equal . This is counting DP. = ways to form from .
If characters match, you can use it or skip it. If they don't match, you must skip. For = 'rabbbit' and = 'rabbit', there are ways to choose which extra 'b' to drop.