Divide Integers

Divide two integers without using multiplication, division and mod operator.

Return the floor of the result of the division.

Example:

5 / 2 = 2

Also, consider if there can be overflow cases. For overflow case, return INT_MAX.

Interview Code Editor
Hints
  • Solution Approach
  • Complete Solution
3079 successful submissions.
Asked In:
  • Microsoft
  • Amazon
Click here to jump start your coding interview preparation