Tap here to switch tabs
Problem
Submissions

Problem: Maximum Subarray Min-Product

Maximum Subarray Min-Product asks you to examine every nonempty contiguous subarray, multiply its sum by its smallest value, and return the largest result modulo a large prime.

Statement

The min product of an array is defined as the minimum value in the array multiplied by the sum of all elements in the array.

Given an array of integers nums, return the maximum min product among all nonempty subarrays of nums. Since the answer can be large, return it modulo 109+710^9 + 7.

Note: The maximum min product must be determined before applying the modulo operation. A subarray is a contiguous sequence of elements within an array.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤107\leq 10^7

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Subarray Min-Product

Maximum Subarray Min-Product asks you to examine every nonempty contiguous subarray, multiply its sum by its smallest value, and return the largest result modulo a large prime.

Statement

The min product of an array is defined as the minimum value in the array multiplied by the sum of all elements in the array.

Given an array of integers nums, return the maximum min product among all nonempty subarrays of nums. Since the answer can be large, return it modulo 109+710^9 + 7.

Note: The maximum min product must be determined before applying the modulo operation. A subarray is a contiguous sequence of elements within an array.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤107\leq 10^7