일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Class
- 43. Multiply Strings
- 프로그래머스
- 315. Count of Smaller Numbers After Self
- data science
- DWG
- 30. Substring with Concatenation of All Words
- 밴픽
- attribute
- 운영체제
- Generator
- 시바견
- concurrency
- t1
- Protocol
- Python Code
- 109. Convert Sorted List to Binary Search Tree
- 파이썬
- 715. Range Module
- iterator
- Substring with Concatenation of All Words
- Python Implementation
- Python
- Decorator
- Regular Expression
- 컴퓨터의 구조
- LeetCode
- shiba
- Convert Sorted List to Binary Search Tree
- kaggle
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