Overflow case question, wrong test case


  • 0
    B

    When I ran my code, I got the following error message.
    Input: 1563847412
    Output: -2147483645
    Expected: 0

    The 32-bit integer's range is from -2,147,483,648 to 2,147,483,647. =(
    It is not overflow..


  • 1
    P

    The input 1563847412 when reversed gives 2,147,483,651 which is greater than 2,147,483,647 (maximum integer value). Hence it is overflow.


Log in to reply
 

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