Why negative number in test case?


  • 0
    R

    The -2147483648 in test case is :
    1000 0000 0000 0000 0000 0000 0000 0000
    ‬ in binary form, so it was regarded as a power of 2 if we think the number is unsigned.

    I think negative numbers in test case is of no meaning and it would be more practical to regard the input as unsigned. ;) ?


Log in to reply
 

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