Why is it -1 instead of 1 for test case 36


  • 0
    Y

    Input : "1.2", "1.10"

    Output: 1

    Expected: -1


  • 1
    Q

    We need to return -1 if second value is greater than first value.
    First pair comparision is 1==1 so we move on to second pair comparison
    2 < 10, so second value is greater and we return -1.


Log in to reply
 

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