일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 시바견
- 프로그래머스
- data science
- Python Implementation
- Generator
- Python
- Regular Expression
- 밴픽
- 315. Count of Smaller Numbers After Self
- 파이썬
- attribute
- Class
- LeetCode
- 컴퓨터의 구조
- Python Code
- 운영체제
- 715. Range Module
- Decorator
- Protocol
- DWG
- Convert Sorted List to Binary Search Tree
- concurrency
- kaggle
- iterator
- shiba
- t1
- 30. Substring with Concatenation of All Words
- 43. Multiply Strings
- 109. Convert Sorted List to Binary Search Tree
- Substring with Concatenation of All Words
Archives
- Today
- Total
목록Gray code (1)
Scribbling
LeetCode: 89. Gray Code
n = 0 n = 1 n=2 n = 3 000 001 101 1100 100 1101 1001 1000 e.g. n=3 -> 100 + 1000, 101 + 1000, 001 + 1000, 000 + 1000 -> 역순 + 2의 n-1승 class Solution: def grayCode(self, n: int) -> List[int]: ret = [0] for i in range(n): ret += [x + pow(2, i) for x in reversed(ret)] return ret
Computer Science/Coding Test
2021. 10. 8. 15:21