leetcode distinct subsequences DP