add distinct subsequences solution