Wrong verification code under C++

  • 0

    I use same logic that pass on C environment fails on C++. I found out that C++ verification code is invalid. For example, if the input 'str' is "2147483648", I returned INT_MAX(2147483647) but the verification code expect "2147483648". That is wrong. Same for the negative value.

    INT_MAX is 2147483647
    INT_MIN is -2147483648
    Input is 2147483648
    myResule is 2147483647

Log in to reply

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