Tap here to switch tabs
Problem
Submissions

Problem: Max Dot Product of Two Subsequences

med
30 min
Try to solve the Max Dot Product of Two Subsequences problem.

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−1extarr1[i]imesextarr2[i]\sum_{i=0}^{k-1} ext{arr1}[i] imes ext{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

med
30 min
Try to solve the Max Dot Product of Two Subsequences problem.

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−1extarr1[i]imesextarr2[i]\sum_{i=0}^{k-1} ext{arr1}[i] imes ext{arr2}[i].

Constraints:

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

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