Please wait a moment while we prepare your experience.
LCS finds the longest sequence of characters that appear in both strings in the same order (not necessarily consecutive). It uses dynamic programming to build a table where dp[i][j] represents the LCS length of str1[0...i-1] and str2[0...j-1].