Solve Distinct Subsequences