Longest-Common-Subsequence
LeetCode 1458: Max Dot Product of Two Subsequences
·2 mins
LeetCode
Hard
Dynamic-Programming
Longest-Common-Subsequence
Array
LeetCode 1458 note: a two-prefix DP; dp[i][j] either pairs nums1[i] with nums2[j] (extending dp[i-1][j-1] or starting fresh) or skips one of them