반응형
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
- 구현
- softeer
- 99항해
- python 2309
- BFS
- 활성화 함수
- boj 2309
- 백준
- 혁펜하임
- easy 딥러닝
- 개발자취업
- 코딩테스트 준비
- til
- leetcode
- 코딩테스트준비
- 기능개발
- 백준 2309
- BOJ
- 스택
- 해시
- 큐
- 99클럽
- dfs
- Python
- 항해99
- 프로그래머스
- 딥러닝
- 알고리즘
- 개발자 취업
- 파이썬
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 |