Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Longest Common Subsequence
Bookmark
Input
Example 1
Example 2 (identical)
Example 3 (no match)
Example 4
Custom
text1
=
abcde
,
text2
=
ace
text1 =
"abcde"
text2 =
"ace"
text2 (j)
text1 (i)
0
1
2
3
∅
a
c
e
0
1
2
3
4
5
∅
a
b
c
d
e
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
longest subsequence common to "abcde" and "ace"? order kept, gaps allowed
algo
master
.
io
Step:
Longest subsequence common to "abcde" and "ace"?
0 / 32
Input
Example 1
Example 2 (identical)
Example 3 (no match)
Example 4
Custom
text1
=
abcde
,
text2
=
ace
0 / 32
text1 =
"abcde"
text2 =
"ace"
text2 (j)
text1 (i)
0
1
2
3
∅
a
c
e
0
1
2
3
4
5
∅
a
b
c
d
e
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
longest subsequence common to "abcde" and "ace"? order kept, gaps allowed
algo
master
.
io
Step:
Longest subsequence common to "abcde" and "ace"?