Given two strings `text1` and `text2`, return the length of their longest common subsequence. If there is no common subsequence, return `0`.
A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.
### Constraints
- `1 <= text1.length, text2.length <= 1000`
- `text1` and `text2` consist of only lowercase English characters.
### Input Format
- Line 1: String `text1`.
- Line 2: String `text2`.
### Output Format
Print the length of the longest common subsequence.
Sample Cases
Example 1Sample Case
Input: abcde
ace
Output: 3
Example 2Sample Case
Input: abc
abc
Output: 3
Example 3Sample Case
Input: abcde
abcde
Output: 5
Constraints
Runtime Limit: 2000 ms per test batch
Memory Limit: 256 MB
Standard I/O stream reading
Official submissions are evaluated against hidden test cases on the server to verify time & memory complexity.