#1143 - Longest Common Subsequence
Given two strings text1 and text2, return the length of their longest common subsequence (LCS). A subsequence is derived by deleting some (or no) characters without changing the order.
| Input | Output |
|---|---|
text1 = "abcde", text2 = "ace" | 3 (LCS = "ace") |
text1 = "abc", text2 = "abc" | 3 |
text1 = "abc", text2 = "def" | 0 |