If keep use labs() but unsigned int for dvd and dvs:
Below test case will time out.
change it to long seems ok.
Because if you take the absolute value of -2147483648 it will over flow as value will be INT_MAX +1
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.