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