Given an array arr, return the sum of the minimum element of every contiguous subarray, taken modulo 1000000007. The input is JSON {arr}.
Input: JSON {arr}.
Output: Integer — the sum of subarray minimums, modulo 1e9+7.
Input: {"arr":[3,1,2,4]}
Output: 17
Explanation: Sum of all subarray minimums.Input: {"arr":[5]}
Output: 5
Explanation: One subarray.Input: {"arr":[11,81,94,43,3]}
Output: 444
Explanation: Weighted minima.1<=n<=3*10^41<=arr[i]<=3*10^4