2019-11-15

# [29] Divide Two Integers


# @lc code=start
class Solution:
    def divide(self, dividend: int, divisor: int) -> int:
        if divisor * dividend <0 and not dividend//divisor==dividend/divisor:
            return max(dividend // divisor + 1,-2147483648)
        return min(dividend // divisor,2147483647)

你可能感兴趣的:(2019-11-15)