| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 시바견
- shiba
- Decorator
- Generator
- 밴픽
- iterator
- 파이썬
- 315. Count of Smaller Numbers After Self
- Class
- kaggle
- Regular Expression
- 715. Range Module
- attribute
- 운영체제
- 30. Substring with Concatenation of All Words
- Python Code
- Protocol
- Convert Sorted List to Binary Search Tree
- Python Implementation
- Substring with Concatenation of All Words
- 프로그래머스
- Python
- DWG
- 109. Convert Sorted List to Binary Search Tree
- concurrency
- 43. Multiply Strings
- 컴퓨터의 구조
- LeetCode
- data science
- t1
Archives
- Today
- Total
목록happy number (1)
Scribbling
LeetCode: 202. Happy Number
class Solution: def isHappy(self, n: int) -> bool: def calc(x): ret = 0 while x > 0: ret += (x % 10)**2 x //= 10 return ret numSet = set([n]) x = n while True: x = calc(x) if x == 1: return True if x in numSet: return False numSet.add(x)
Computer Science/Coding Test
2021. 12. 21. 20:25