Expected result seems wrong..


  • 0
    W

    Input: [[-1],[2,3],[1,-1,-3]]
    Output: -2
    Expected: -1.

    Isn't -2 correct here?


  • 1
    S

    Pay attention the description in problem

    Each step you may move to adjacent numbers on the row below.

    In terms of this test case, the answer should be like this

      [-1]
      2 [3]
    1 -1 [-3]
    

    instead of

      [-1]
      [2] 3
    1 -1 [-3]
    

    Since it is impossible to move from [2] to [-3].


  • 0
    W

    Yea makes sense now. Thanks! I overlooked that.


Log in to reply
 

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