Notice
Recent Posts
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 |
Tags
- TiL
- 항해99
- 개발자부트캠프추천
- 인프콘 2024
- spring batch 5.0
- 1주일회고
- 취업리부트코스
- jwt
- 전략패턴 #StrategyPattern #디자인패턴
- 디자인 패턴
- JavaScript
- KPT회고
- 파이썬
- 99클럽
- 개발자 취업
- 코딩테스트 준비
- jwttoken
- 구글 OAuth login
- Spring multimodule
- 커스텀 헤더
- Python
- 단기개발자코스
- @FeignClient
- DesignPattern
- 프로그래머스
- 빈 조회 2개 이상
- 프로그래머스 이중우선순위큐
- 빈 충돌
- infcon 2024
- 디자인패턴
Archives
- Today
- Total
m1ndy5's coding blog
LeetCode 225. Implement Stack using Queues 본문
https://leetcode.com/problems/implement-stack-using-queues/
class MyStack:
def __init__(self):
self.q = []
def push(self, x: int) -> None:
self.q.append(x)
def pop(self) -> int:
return self.q.pop()
def top(self) -> int:
return self.q[-1]
def empty(self) -> bool:
return len(self.q)==0
queue를 이용하여 Stack을 만들어보는 자료구조 문제였다.
'알고리즘 with python > 알고리즘 스터디' 카테고리의 다른 글
LeetCode 739. Daily Temperatures with Python (1) | 2024.01.04 |
---|---|
LeetCode 232. Implement Queue using Stacks with Python (0) | 2024.01.04 |
LeetCode 561. Array Partition with Python (1) | 2024.01.03 |
LeetCode 15. 3Sum with Python (2) | 2024.01.03 |
LeetCode 5. Longest Palindromic Substring with Python (1) | 2024.01.03 |