Distinct Subsequences: non-optimized answer
Distinct Subsequences: correct answer