Input : [1, -1], 1
My code returns: [1,1]
I think the expectation is wrong.
I had the same thoughts as well at first. But then I realize that the max means the max in the current window. Therefore, for a window of size 1, it basically is the original vector.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.