Given two strings text1 and text2, return the length of their longest common subsequence. A subsequence is a string generated by deleting some or no characters without changing relative order.
Examples
Input:text1 = 'abcde', text2 = 'ace'
Output:3
The LCS is 'ace', length 3.
Input:text1 = 'abc', text2 = 'def'
Output:0
No common characters.
Constraints
• 1 <= text1.length, text2.length <= 1000
• Strings contain only lowercase English characters.