일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- iterator
- 715. Range Module
- 운영체제
- Substring with Concatenation of All Words
- concurrency
- DWG
- 프로그래머스
- LeetCode
- 파이썬
- 109. Convert Sorted List to Binary Search Tree
- kaggle
- 시바견
- 컴퓨터의 구조
- attribute
- Python Implementation
- Python
- 30. Substring with Concatenation of All Words
- Protocol
- Regular Expression
- 43. Multiply Strings
- Python Code
- shiba
- Decorator
- data science
- Convert Sorted List to Binary Search Tree
- t1
- 315. Count of Smaller Numbers After Self
- Class
- 밴픽
- Generator
Archives
- Today
- Total
목록50. Pow (1)
Scribbling
LeetCode: 50. Pow(x, n)
class Solution: def myPow(self, x: float, n: int) -> float: if n == 0: return 1 if x == 1: return 1 if x == -1: if abs(n) % 2 == 0: return 1 else: return -1 if x == 0: return 0 n_sign = True if n > 0 else False res = 1 count = 0 while count < abs(n): multiplier = x step = 1 while step
Computer Science/Coding Test
2021. 9. 2. 00:43