Given an array of integers A, find the sum of min(B), where B ranges over every (contiguous) subarray of A. Since the answer may be large, return the answer modulo 10^9 + 7. Example 1: Input: [3,1,2,4] Output: 17 Explanation: Subarrays are [3], [1],…