Example 1
- Input
- text1 = "abcde", text2 = "ace"
- Output
- 3
Choose a, c, and e at positions 0, 2, and 4 of abcde; ace supplies the same three characters in order. Length 3 reaches the shorter string length, so no longer answer is possible. The gaps show that this is a subsequence, not a substring.