반응형
Recent Posts
Notice
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- Python
- 딥러닝
- easy 딥러닝
- 프로그래머스
- 백준
- 99항해
- BFS
- 코딩테스트 준비
- 항해99
- 개발자취업
- softeer
- 기능개발
- 활성화 함수
- dfs
- leetcode
- til
- 파이썬
- 혁펜하임
- 큐
- 알고리즘
- boj 2309
- 99클럽
- BOJ
- 스택
- 코딩테스트준비
- 개발자 취업
- python 2309
- 구현
- 해시
- 백준 2309
Archives
- Today
- Total
동까의 코딩
[99클럽] 34일차 TIL 본문
반응형
https://leetcode.com/problems/flatten-nested-list-iterator/
class NestedIterator(object):
def __init__(self, nestedList):
def dfs(nestedList):
for item in nestedList:
if item.isInteger():
self.stack.append(item.getInteger())
else:
dfs(item.getList())
self.stack = []
dfs(nestedList)
def next(self):
if self.hasNext():
return self.stack.pop(0)
def hasNext(self):
return self.stack != []
반응형
'문제 풀이 > 99클럽' 카테고리의 다른 글
| [99클럽] 36일차 TIL (0) | 2024.06.25 |
|---|---|
| [99클럽] 35일차 TIL (0) | 2024.06.25 |
| [99클럽] 33일차 TIL (0) | 2024.06.22 |
| [99클럽] 32일차 TIL (1) | 2024.06.21 |
| [99클럽] 31일차 TIL (0) | 2024.06.20 |