生产队的驴儿的博客链接 ...代码 class Solution { public int divide(int dividend, int divisor) { // 当除数为1,直接返回被除数 if (divisor == 1) { ... // 当除数为-1且被除数为Integer.MIN_VALUE时,将会溢出,返回Integer.MAX_
weixin_44316285的博客29、两数相除 思路:不断相减就是求解的最直接方法,我这样计算时间复杂度有点高 // 时间复杂度O(count*divisor) // 空间复杂度O(1) class Solution { int res = 0; public int divide(int dividend, int divisor) {...