distinct subsequences, quick version