일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- LeetCode
- t1
- Substring with Concatenation of All Words
- 315. Count of Smaller Numbers After Self
- 밴픽
- Convert Sorted List to Binary Search Tree
- Python Implementation
- Regular Expression
- attribute
- 파이썬
- 프로그래머스
- 109. Convert Sorted List to Binary Search Tree
- 30. Substring with Concatenation of All Words
- Python Code
- DWG
- Protocol
- Decorator
- 시바견
- data science
- Class
- iterator
- concurrency
- kaggle
- Python
- 715. Range Module
- 컴퓨터의 구조
- 운영체제
- shiba
- 43. Multiply Strings
- Generator
Archives
- Today
- Total
목록341. Flatten Nested List Iterator (1)
Scribbling
LeetCode: 341. Flatten Nested List Iterator
Making a new list is an easy solution to implement with recursion. class NestedIterator: def __init__(self, nestedList: [NestedInteger]): self.res = [] self._flattener(nestedList) self.ptr = 0 def _flattener(self, nestedList): for nl in nestedList: if nl.isInteger(): self.res.append(nl.getInteger()) else: self._flattener(nl.getList()) def next(self) -> int: ret = self.res[self.ptr] self.ptr += 1..
Computer Science/Coding Test
2022. 1. 13. 14:43