Problem Statement
Given two strings text1 and text2, return the length of their longest common subsequence.
Approach
dp[i][j] represents LCS length of text1[0..i] and text2[0..j]. If chars match, 1 + dp[i-1][j-1]. Else, max(dp[i-1][j], dp[i][j-1]).
Time & Space Complexity
Time complexity is O(M * N). Space complexity is O(M * N).
