Test Cases Contradicting


  • 0
    P

    For these two test cases:

    we see the difference between a[j]-a[i] = 1-2 = -1 where j!=i && j>i and t=1
    [2,1]
    1
    1
    Expected answer
    true

    we see the difference between a[j]-a[i] = 2-1 = 1 where j!=i && j>i and t = -1
    [1,2]
    1
    -1
    Expected answer
    false

    Either both should be true or both should be false. How is it that one is true while other is false? Could somebody explain?


Log in to reply
 

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