| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 뭐든
- 3줄정리
- 매일
- 스탭퍼
- English
- 링피트
- realclass
- 프로젝트
- 파비최
- 30분
- 사이드
- leetcode
- 쓰릴오브파이트
- 10분
- Daily Challenge
- 영어원서읽기
- 리얼 클래스
- 운동
- 화상영어
- 잡생각
- 개발자
- Writing
- 월간
- FIT XR
- Problem Solving
- 미드시청
- 영어공부
- 만화도
- 괜찮음
- 읽기
Archives
- Today
- Total
파비의 매일매일 공부기록
Today's Challenge 본문
https://leetcode.com/problems/implement-queue-using-stacks/
Implement Queue using Stacks - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
list로 queue 구현 하면 되는 문제.
고민할 게 거의 없었음.
class MyQueue:
def __init__(self):
self.qu = []
def push(self, x: int) -> None:
self.qu.append(x)
def pop(self) -> int:
return self.qu.pop(0)
def peek(self) -> int:
return self.qu[0]
def empty(self) -> bool:
return len(self.qu) == 0반응형
'Problem Solving > LeetCode' 카테고리의 다른 글
| Today's Challenge (0) | 2022.12.18 |
|---|---|
| Today's Challenge (0) | 2022.12.17 |
| Today's Challenge (0) | 2022.12.15 |
| Today's Challenge (0) | 2022.12.14 |
| Today's Challenge (0) | 2022.12.13 |
Comments