Live Batches
Masterclasses
Menu
Free Courses
Account
Login / Sign Up
Problem Submissions Solution

Maximize dot product

Difficulty: Medium

Acceptance: 13.27%

Points: 30.00

Given two arrays **a** and **b** of positive integers of size **n** and **m** where **n >= m**, the task is to maximize the dot product by inserting zeros in the second array but you cannot disturb the order of elements. Dot product of array a and b of size n is **a[0]\*b[0] + a[1]\*b[1] + ... + a[n-1]\*b[n-1].**

Topics

Companies

Articles

Examples:

Expected Time Complexity: O(n*m)

Expected Auxiliary Space: O(n*m)

Constraints:
  • 1 = m =n = 10^3
  • 1 = a[i], b[i] = 10^3
Companies:
Samsung Adobe IBM
Topics:
Dynamic Programming
Locked Content
Access Restricted: Please Login to access the code editor and test cases.