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 | 29 | 30 | 31 |
Tags
- JavaScript
- jwttoken
- 1주일회고
- TiL
- 빈 조회 2개 이상
- 디자인 패턴
- infcon 2024
- 구글 OAuth login
- 전략패턴 #StrategyPattern #디자인패턴
- Spring multimodule
- 인프콘 2024
- 커스텀 헤더
- Python
- 단기개발자코스
- spring batch 5.0
- 항해99
- jwt
- 개발자 취업
- 99클럽
- 빈 충돌
- 코딩테스트 준비
- 개발자부트캠프추천
- 취업리부트코스
- @FeignClient
- KPT회고
- 디자인패턴
- 프로그래머스
- DesignPattern
- 파이썬
- 프로그래머스 이중우선순위큐
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 |