Compare characters at positions i and j. If text1[i] == text2[j], they're part of the LCS. Add to the LCS of the remaining prefixes. If they differ, take the max of either excluding text1[i] or excluding text2[j]. dp[i][j] = LCS length for text1[..i-] and text2[..j-].
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/dynamic-programming/lcs-hint
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████████████████████████████████████████████████████████████████████████████