일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- concurrency
- 109. Convert Sorted List to Binary Search Tree
- 밴픽
- kaggle
- 컴퓨터의 구조
- Decorator
- Substring with Concatenation of All Words
- Protocol
- 파이썬
- DWG
- 315. Count of Smaller Numbers After Self
- Convert Sorted List to Binary Search Tree
- 운영체제
- 30. Substring with Concatenation of All Words
- Python Code
- t1
- shiba
- Generator
- Python Implementation
- 시바견
- 프로그래머스
- attribute
- Regular Expression
- 715. Range Module
- iterator
- LeetCode
- Python
- 43. Multiply Strings
- data science
- Class
Archives
- Today
- Total
목록Restore Ip Addresses (1)
Scribbling
LeetCode: 93. Restore IP Addresses
class Solution: def restoreIpAddresses(self, s: str) -> List[str]: self.ret = [] self.nums = set([str(i) for i in range(256)]) self.helper(s, []) return self.ret def helper(self, s, ip): if len(ip) == 4: if not s: self.ret.append('.'.join(ip)) return if not s: return for i in range(min(3, len(s))): if s[:i+1] in self.nums: self.helper(s[i+1:], ip+[s[:i+1]])
Computer Science/Coding Test
2021. 10. 11. 16:06