Don't understand why long long is still needed.


  • 0
    L

    If keep use labs() but unsigned int for dvd and dvs:
    Below test case will time out.
    -2147483648
    1

    change it to long seems ok.


  • 2
    B

    Because if you take the absolute value of -2147483648 it will over flow as value will be INT_MAX +1


Log in to reply
 

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