Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Distinct Subsequences
Bookmark
Input
Example 1
Example 2
Example 3
Custom
s
=
abc
,
t
=
ab
s =
"abc"
t =
"ab"
t (j)
s (i)
0
1
2
∅
a
b
0
1
2
3
∅
a
b
c
0
0
0
0
0
0
0
0
0
0
0
0
how many ways to spell "ab" by picking chars of "abc" in order?
algo
master
.
io
Step:
How many ways can "ab" be spelled by picking chars of "abc" in order?
0 / 14
Input
Example 1
Example 2
Example 3
Custom
s
=
abc
,
t
=
ab
0 / 14
s =
"abc"
t =
"ab"
t (j)
s (i)
0
1
2
∅
a
b
0
1
2
3
∅
a
b
c
0
0
0
0
0
0
0
0
0
0
0
0
how many ways to spell "ab" by picking chars of "abc" in order?
algo
master
.
io
Step:
How many ways can "ab" be spelled by picking chars of "abc" in order?