Count how many times appears as a subsequence of . Let = count for and . If : we can match this character () or skip it (). Total: . If they don't match: must skip . . Example: , .
Answer: (three ways to choose which 'b' to skip).
Counting occurrences
Count how many times appears as a subsequence of . Let = count for and . If : we can match this character () or skip it (). Total: . If they don't match: must skip . . Example: , .
Answer: (three ways to choose which 'b' to skip).