907. Sum of Subarray Minimums
Problem Statement
Given an array of integers arr, find the sum of min(b)
, where b
ranges over every (contiguous) subarray of arr
. Since the answer may be large, return the answer modulo 109 + 7
.
Example 1:
Example 2:
Constraints:
1 <= arr.length <= 3 * 104
1 <= arr[i] <= 3 * 104
Intuition
Links
https://leetcode.com/problems/sum-of-subarray-minimums/description/
Video Links
Approach 1:
C++
Approach 2:
C++
Approach 3:
C++
Approach 4:
C++
Similar Problems
Last updated