Problem 2104 · Medium
Sum the difference between maximum and minimum over every contiguous subarray.
Open the interactive visualisation