https://leetcode.com/problems/divide-two-integers/?envType=featured-list&envId=top-google-questions
input :
output :
조건 :
Solution explain : Solution1
class Solution:
def divide(self, dividend: int, divisor: int) -> int:
ret = dividend / divisor
if ret < -2 ** 31:
return -2 ** 31
if ret > 2 ** 31 - 1:
return 2 ** 31 - 1
return int(ret)
글 잘 봤습니다, 많은 도움이 되었습니다.