Practice Maximum Subarray Min-Product
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
The min-product of an array is equal to the minimum value in the array multiplied by the array's sum. Given an array of integers nums, return the maximum min-product of any non-empty subarray of nums. Since the answer may be large, return it modulo 10^9 + 7. Note that the min-product should be maximized before performing the modulo operation. Testcases are generated such that the maximum min-product without modulo will fit in a 64-bit signed integer. A subarray is a contiguous part of an array.
Source: Maximum Subarray Min-Product on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
nums = [1,2,3,2]
14
# Example 2
nums = [2,3,3,1,2]
18
# Example 3
nums = [3,1,5,6,4,2]
60
Constraints
Related LeetCode Problems
Practice more problems similar to Maximum Subarray Min-Product.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.