[1,1,-3,-1,-1] gives false but [1,-1,-3,-1,-1] gives true?


  • 0
    T

    in case1: [1,1,-3,-1,-1], a valid loop may be a2 -> a4 -> a3 -> a2
    in case2: [1,-1,-3,-1,-1], the valid loop is the same with case2

    is there sth. wrong about my understanding?


Log in to reply
 

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