Find the length of the longest common subsequence of two strings.
A subsequence maintains relative order but doesn't need to be contiguous.
With text1 = "abcde", text2 = "ace":
- "ace" is a subsequence of both.
- Length: .
With text1 = "abc", text2 = "abc":
- "abc" itself is common.
- Length: .
With text1 = "abc", text2 = "def":
- No common characters.
- Length: .
Constraints: text1.length, text2.length .