I'm confused as to why this is wrong.
If k is 1, shouldn't the result be an array of length 1?
If k=1 then there are two windows of size k=1:
 and [-1]
Each window has a different max.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.