temps. For a report, take a window of width consecutive readings, place it at the start of the array, and shift it right one reading at a time until it reaches the end.
For every position of the window, find the highest temperature inside it. Return these values in the order the window moves; there are len(temps) - width + 1 of them.temps=[2, 7, 3, -1, 4, 4, 0], width=3 → [7, 7, 4, 4, 4]
The windows are [2, 7, 3] → 7, [7, 3, -1] → 7, [3, -1, 4] → 4, [-1, 4, 4] → 4, [4, 4, 0] → 4.
temps=[-5, -2, -8], width=1 → [-5, -2, -8]
A window of one reading is just that reading.
temps=[6, 1, 9, 2], width=4 → [9]
There is a single window covering everything; its maximum is 9.
len(temps) ≤ 10⁵temps[i] ≤ 10⁴width ≤ len(temps)temps=[2, 7, 3, -1, 4, 4, 0], width=3
[7, 7, 4, 4, 4]
Run checks the first 3 tests in your browser. Submit checks all 107 tests on the server, hidden ones included.