Given an integer array, return the sum of the minimum element of every contiguous subarray, modulo 10^9 + 7. Aim better than the O(n log n) first solution, ideally O(n).
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.