Why wrong answer?


  • 0
    E

    I'm confused as to why this is wrong.
    If k is 1, shouldn't the result be an array of length 1?

    Input:
    [1,-1]
    1

    My output:
    [1]

    Expected:
    [1,-1]


  • 0

    If k=1 then there are two windows of size k=1:
    [1] and [-1]
    Each window has a different max.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.