일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- attribute
- 컴퓨터의 구조
- 운영체제
- Protocol
- 30. Substring with Concatenation of All Words
- shiba
- 시바견
- LeetCode
- Generator
- kaggle
- 109. Convert Sorted List to Binary Search Tree
- DWG
- 315. Count of Smaller Numbers After Self
- iterator
- 715. Range Module
- 프로그래머스
- 밴픽
- Regular Expression
- t1
- Decorator
- Python Implementation
- Class
- Convert Sorted List to Binary Search Tree
- Python
- Python Code
- 파이썬
- concurrency
- data science
- Substring with Concatenation of All Words
- 43. Multiply Strings
Archives
- Today
- Total
목록22. Generate Parentheses (1)
Scribbling
LeetCode: 22. Generate Parentheses
class Solution: def generateParenthesis(self, n: int) -> List[str]: self.ret = [] self.helper(n, n, '') return self.ret def helper(self, l, r, path): if l == 0: self.ret.append(path + (')' * r)) return if l == r: self.helper(l-1, r, path + '(') else: self.helper(l-1, r, path + '(') self.helper(l, r-1, path + ')')
Computer Science/Coding Test
2021. 8. 24. 22:33