Practice Maximum Score from Performing Multiplication Operations
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Hard#1770
LeetCode ProblemMaximum Score from Performing Multiplication Operations
Problem Statement
Start with score 0 and perform exactly multipliers.length operations. At operation i, remove either the first or last remaining value x of nums and add multipliers[i] * x to the score. Return the greatest final score; nums has at least as many entries as multipliers.
Source: Maximum Score from Performing Multiplication Operations on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
nums = [1,2,3], multipliers = [3,2,1]
Output
14
# Example 2
Input
nums = [-5,-3,-3,-2,7,1], multipliers = [-10,-5,3,4,6]
Output
102
Constraints
n == nums.length
m == multipliers.length
1 <= m <= 300
m <= n <= 10^5
-1000 <= nums[i], multipliers[i] <= 1000
Related LeetCode Problems
Practice more problems similar to Maximum Score from Performing Multiplication Operations.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.