The recurrence: If text1[i-] == text2[j-]: dp[i][j] = dp[i-][j-] + Else: dp[i][j] = max(dp[i-][j], dp[i][j-]) Base case: dp[][j] = dp[i][] = (empty string has no common subsequence). Build the table row by row.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/dynamic-programming/lcs-solution
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████████████████████████████████████████████████████████████████████████████████