The TransCompilator

Solved LeetCode program · 208 of 1,000

#0239 · Sliding Window Maximum

Hard Array chunk-05.md

Original English source

Keep a shared numbers holding 1, 3, -1, -3, 5, 3, 6, and 7. Keep a shared last of 7. Keep a shared best of 0.
To scan from target (a whole number) with width (a whole number). Set best to item target of numbers. The final is target plus width minus 1.
For every offset from target to final.
The value is item offset of numbers. If value is more than best, set best to value.

The limit is last minus 2.
For every start from 0 to limit.
Scan from start with 3. Show best.

Open in Playground Browse all 1,000 problems

Expected stdout

3
3
5
5
6
7