Your question is Integer Division Without Operators. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
At Stripe, you need to implement integer division for a low-level utility where the / and * operators are not allowed. Given two integers dividend and divisor, return the quotient after dividing dividend by divisor.
Truncate toward zero, as in most programming languages. You may not use multiplication, division, or modulus operators.
dividend and divisordividend / divisor, truncated toward zero2147483647def divide_integers(dividend, divisor):