C++, 3ms, faster trick


  • 0
    S
    if (n>0)return 0x80000000 == 0x80000000 / n * n;
            return false;
    

    the code should speak for itself. just math.


Log in to reply
 

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