Input cases for String to Integer question (#8)


  • 0
    Y

    Hi all,

    I am trying to solving the String to Integer problem. But after submitting my code, I got strange running errors.

    For example, with the input "+-2", I think the output should be -2, but the answer is 0...
    Input:
    "+-2"
    Output:
    -2
    Expected:
    0

    Moreover, I also encountered the input like "0k4", I would like to make it to be illegal argument input, what is the supposed output integer for it?

    Thanks


Log in to reply
 

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