[LeetCode]Sum of Subarray Minimums

原题Given an array of integersA, find the sum ofmin(B), whereBranges overevery (contiguous) subarray ofA.Since the answer may be large,return the answer modulo10^9 + 7.Example 1Input: [3,1,2,4Output: 1Explanation: Subarrays are [3], [1], [2], [4], [3,1], [1,2], [2,4], [3,1,2], [1,2,4], [3,1,2,4].Minimums are 3, 1, 2, 4, 1, 1, 2, 1, 1, 1. Sum is 17.Note1 <= A.length <= 300001 <= A[i] <题解首先明确题... Read More