Skip to content
Skein

longest common subsequence (LCS)

RU: наибольшая общая подпоследовательность (LCS)

The longest sequence of characters that appears, in order but not necessarily adjacent, in both of two strings. With dp[i][j] as the LCS length of the first i and j characters, the table adds 1 to dp[i-1][j-1] on a match and otherwise takes max(dp[i-1][j], dp[i][j-1]).

shortcutsexpand
search
⌘K
prev piece
k
next piece
j
cycle tier
t
this menu
?