Practice Maximum Multiplication Score
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given an integer array a of size 4 and another integer array b of size at least 4. You need to choose 4 indices i0, i1, i2, and i3 from the array b such that i0 < i1 < i2 < i3. Your score will be equal to the value a[0] * b[i0] + a[1] * b[i1] + a[2] * b[i2] + a[3] * b[i3]. Return the maximum score you can achieve.
Source: Maximum Multiplication Score on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
a = [3,2,5,6], b = [2,-6,4,-5,-3,2,-7]
26
# Example 2
a = [-1,4,5,-2], b = [-5,-1,-3,-2,-4]
-1
Constraints
Related LeetCode Problems
Practice more problems similar to Maximum Multiplication Score.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.