Divide two integers without using multiplication, division and mod operator.
If it is overflow, return MAX_INT.
看了网上的拆分思路,逻辑写出来是不难的,但-2147483648/1和-2147483648/-1是难点
package pack;
class Solution {
public int divide(int dividend, int divisor) {
return (int)divideL(dividend, divisor); //如果不用去long里面做,-2147483648/1很难解决
}
/*例如计算:87/4
* 87=4*2^4+4*2^2+4*2^1
* 8