← 返回 bytedance 的题目列表Divide Two Integers
类型:online_judge
Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operators. Return the quotient after dividing dividend by divisor. The quotient should truncate towards zero, which means losing its fractional part. Assume we are dealing with an environment that could only store integers within the 32-bit signed integer range: [−2^31, 2^31 − 1]. For this problem, if the quotient is strictly greater than 2^31 − 1, return 2^31 − 1.
Example
Input
10 3