Integer Overflow Issue ~


  • 0
    S

    It is quite sad that this problem does not support Java8. For this question, using Java8, you can use multiplyExact in the Java Math Library to check for overflow.

    So now, it's probably better to find another way to deal with an integer overflow for (mid * mid)...


  • 0
    L

    You can use (x/mid) to compare with mid


Log in to reply
 

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