Solution to Distinct Subsequences by LeetCode

7 Jul


Question Name: Distinct Subsequences

This is a dynamic programming challenge. Firstly I solved it with recursion. But that solution did not satisfy the time requirement. These two posts give more details about the right solution: LeetCode: Distinct Subsequences(不同子序列的个数)(in Chinese) and Distinct Subsequences DP explanation (in English).

Leave a Reply

Your email address will not be published. Required fields are marked *