
Given two strings s and t, return the length of their longest common subsequence.
A subsequence is obtained by deleting zero or more characters without changing the relative order of the remaining characters.
s
: string
t
: string
s
and
t
.
0 <= len(s), len(t) <= 2000
s = "abcde"
,
t = "ace"
→ output
3
(one LCS is
"ace"
).