Bad test case?


  • 0
    C

    I'm a little confused on the second test case... Where the answer is 2

    [-2, -1, 2, 1]
    1
    

    When I run my code it tells me that the longest subarray is 2, but [2, -2, 1] equals 1 with a length of 3 which is larger than 2. Where is my understanding flawed.


Log in to reply
 

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