A performance report takes every contiguous run of frame rates in fps (every subarray, of every length), finds its lowest value, and adds all those lowest values together as a "stutter score".
Write minimumTotal(fps) that returns that sum, modulo 1000000007 (10^9 + 7).
Input: fps = [3,1,2,4] Output: 17
The 10 subarrays have minimums 3, 1, 2, 4, 1, 1, 2, 1, 1, 1, which add up to 17.
Input: fps = [11,81,94,43,3] Output: 444
Summing the minimum of all 15 subarrays gives 444.
1 <= fps.length <= 3 * 10^41 <= fps[i] <= 3 * 10^4Run tries your code on the examples. Submit runs every test, including hidden edge cases, and solves the problem when they all pass.
Ctrl + Enter runs, Ctrl + Shift + Enter submits (⌘ on a Mac).
I'm here to help with #271 Total of Window Minimums. I give hints, never the solution, so you get to solve it yourself. Ask for a hint, select code to ask about it, or press Ask Tuto why on a failing test.
Your first 3 answers need no account. for free to keep asking.