Find the longest common subsequence of two strings. Elements don't need to be contiguous.
2D DP: if chars match, dp[i][j] = dp[i-1][j-1] + 1. Otherwise, dp[i][j] = max(dp[i-1][j], dp[i][j-1]).
💡 Pro tip: Understand this problem deeply — don't just memorize the code. Try explaining the approach out loud as if teaching a friend. If you can explain it simply, you truly understand it!
longestCommonSubsequence('abcde', 'ace')
3