Count the number of distinct subsequences of s that equal t.
A subsequence keeps characters in order but can skip elements.
With s = "rabbbit", t = "rabbit":
- You can form "rabbit" by choosing different 'b's from "rabbbit".
- Pick b at index 2: ra[b]bbit → rabbit.
- Pick b at index 3: rab[b]bit → rabbit.
- Pick b at index 4: rabb[b]it → rabbit.
- distinct ways.
With s = "babgbag", t = "bag":
- Multiple ways to pick 'b', 'a', 'g' from s.
- distinct subsequences.
Constraints: s.length, t.length .