일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 만화도
- 읽기
- 괜찮음
- 잡생각
- leetcode
- English
- 영어공부
- 운동
- 미드시청
- 리얼 클래스
- 파비최
- 매일
- 스탭퍼
- 쓰릴오브파이트
- 30분
- Daily Challenge
- 사이드
- 링피트
- FIT XR
- Writing
- 프로젝트
- 월간
- realclass
- 뭐든
- 3줄정리
- 화상영어
- 영어원서읽기
- 10분
- Problem Solving
- 개발자
Archives
- Today
- Total
파비의 매일매일 공부기록
Today's Challenge 본문
https://leetcode.com/problems/implement-stack-using-queues
Implement Stack using Queues - 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 이용해서 풀면 매우 간단하게 해결된다.
class MyStack:
def __init__(self):
self.st = []
def push(self, x: int) -> None:
self.st.append(x)
def pop(self) -> int:
return self.st.pop()
def top(self) -> int:
return self.st[-1]
def empty(self) -> bool:
return not self.st
반응형
'Problem Solving > LeetCode' 카테고리의 다른 글
Today's Challenge (0) | 2022.05.07 |
---|---|
Today's Challenge (0) | 2022.05.06 |
Today's Challenge (0) | 2022.05.04 |
Today's Challenge (0) | 2022.05.03 |
Today's Challenge (0) | 2022.05.02 |
Comments