Given two numbers n and m, divide n by m without using the division operator. Return both the integer answer as well as the remainder.
This actually can get messy depending on your understanding of “Remainder”. One solution is shown below.
And for unit test:
- Avoid the know boundary condition in the 10000 loop
- Test explicitly for boundary condition afterwards.