115. implement BigInt division

JavaScript
Is this helpful ?

from all members: - accepted / - tried

This is a follow-up on 114. implement BigInt multiplication.

You are asked to create a BigInt division function.

divide(
  '1123456787654323456789', 
  '1234567887654323456'
)
// '910'

divide(
  '-1123456787654323456789', 
  '1234567887654323456'
)
// '-910'

Notice the result should be rounded towards 0.

divide(
  '5', 
  '2'
)
// '2'

divide(
  '-3', 
  '2'
)
// '-1'

Let's try to solve this problem within 20 mintues.

Discuss(1)