Implement integer division using only bit shifts and basic arithmetic, no division or modulo operators.
Constraints
Example
```python >>> divide(10, 3) 3 >>> divide(7, -3) -2 >>> divide(-2147483648, -1) 2147483647 >>> divide(0, 5) 0 >>> divide(1, 0) ValueError: division by zero ```
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints