Longest Common Subsequence (LCS)

Medium

📝 Description

Find the length of the longest subsequence common to two strings.

Input Format

text1 (string), text2 (string)

Output Format

integer (length of LCS)

Constraints

1 ≤ text.length ≤ 1000

🔍 Sample Input

"abcde", "ace"
            

✅ Sample Output

3
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run