5 Comments
User's avatar
Giorgi_PA's avatar

Perhaps you have a small misprint {2,5,5}, but i think it should be {2,-3,5}

Expand full comment
Šimon Tóth's avatar

You are not looking for a maximum window, you are calculating the maximum from each position of the sliding window.

Expand full comment
Giorgi_PA's avatar

So idea is find maksimum between nums in window on each step?

If we have e.g 0,-1,-2,1,1 and size 2 we will get 0,-1,1,1 ???? Is it correct suggestion?

Expand full comment
Šimon Tóth's avatar

Yup, that's it.

Expand full comment
Giorgi_PA's avatar

Oh, now i catch the idea. Sorry for incorrect comment. :)

Expand full comment