일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 쓰릴오브파이트
- 개발자
- 사이드
- 파비최
- 리얼 클래스
- 미드시청
- Daily Challenge
- 월간
- 스탭퍼
- 뭐든
- 영어원서읽기
- 잡생각
- FIT XR
- 매일
- 30분
- 3줄정리
- 화상영어
- 프로젝트
- English
- 읽기
- 10분
- 링피트
- Writing
- realclass
- 만화도
- 운동
- leetcode
- 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