Tap here to switch tabs
Problem
Submissions

Problem: Max Dot Product of Two Subsequences

Max Dot Product of Two Subsequences asks you to choose nonempty subsequences of equal length from two arrays and return the largest possible sum of paired products, preserving order even when values may be negative.

Statement

Given two integer arrays nums1 and nums2, return the maximum dot product between non empty subsequences of nums1 and nums2 of the same length.

Note:
A subsequence of an array is formed by deleting some or no elements without changing the relative order of the remaining elements.
The dot product of two arrays arr1 and arr2 of equal length kk is calculated as ∑i=0k−1arr1[i]×arr2[i]\sum_{i=0}^{k-1} {arr1}[i] \times {arr2}[i].

Constraints:

  • 1≤1 \leq nums1.length, nums2.length ≤500\leq 500

  • −1000≤-1000 \leq nums1[i], nums2[i] ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Max Dot Product of Two Subsequences

Max Dot Product of Two Subsequences asks you to choose nonempty subsequences of equal length from two arrays and return the largest possible sum of paired products, preserving order even when values may be negative.

Statement

Given two integer arrays nums1 and nums2, return the maximum dot product between non empty subsequences of nums1 and nums2 of the same length.

Note:
A subsequence of an array is formed by deleting some or no elements without changing the relative order of the remaining elements.
The dot product of two arrays arr1 and arr2 of equal length kk is calculated as ∑i=0k−1arr1[i]×arr2[i]\sum_{i=0}^{k-1} {arr1}[i] \times {arr2}[i].

Constraints:

  • 1≤1 \leq nums1.length, nums2.length ≤500\leq 500

  • −1000≤-1000 \leq nums1[i], nums2[i] ≤1000\leq 1000