일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- Decorator
- attribute
- kaggle
- concurrency
- 밴픽
- Protocol
- iterator
- Python
- 컴퓨터의 구조
- DWG
- 30. Substring with Concatenation of All Words
- Convert Sorted List to Binary Search Tree
- 프로그래머스
- Generator
- data science
- 109. Convert Sorted List to Binary Search Tree
- 715. Range Module
- shiba
- Python Code
- 운영체제
- Python Implementation
- 파이썬
- LeetCode
- 시바견
- Class
- t1
- Regular Expression
- 43. Multiply Strings
- Substring with Concatenation of All Words
- 315. Count of Smaller Numbers After Self
Archives
- Today
- Total
목록29. Divide Two Integers (1)
Scribbling
LeetCode: 29. Divide Two Integers
* Note: shift left is the same as multiplying by two. class Solution: def divide(self, dividend: int, divisor: int) -> int: # Overflow if dividend == -2**31 and divisor == -1: return 2**31 - 1 # Positive? positive = (dividend > 0) is (divisor > 0) dividend = abs(dividend) divisor = abs(divisor) res = 0 subtract = divisor while divisor
Computer Science/Coding Test
2021. 9. 2. 22:05