NumPy allowed · plain Python earns 10 bonus points
Find the length of the longest subsequence shared between two text sequences using 2D DP.
Implement longest_common_subsequence(text1, text2): if text1[i] == text2[j], dp[j] = prev + 1; otherwise dp[j] = max(dp[j], dp[j-1]).
longest_common_subsequence(text1: str, text2: str) -> int