Medium
Find the length of the longest common subsequence of two strings.
Return the length of the longest subsequence present in both strings while preserving relative order.
Examples
Input: text1 = "abcde", text2 = "ace"
Output: 3
Constraints
- 1 <= text1.length, text2.length