LeetCode – Divide Two Integers (Java) is the right answer, tested.
This problem can be solved based on the fact that any number can be converted to the format of the following, Power series of 2:
num=a_0*2^0+a_1*2^1+a_2*2^2+...+a_n*2^n
Java
1 | class Solution { |
Submission Detail
- 989 / 989 test cases passed.
- Runtime: 31 ms
- Your runtime beats 30.12 % of java submissions.