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
- 구글 OAuth login
- TiL
- 99클럽
- 파이썬
- 디자인패턴
- 항해99
- 인프콘 2024
- spring batch 5.0
- 전략패턴 #StrategyPattern #디자인패턴
- jwttoken
- 커스텀 헤더
- 디자인 패턴
- 개발자 취업
- DesignPattern
- @FeignClient
- 프로그래머스 이중우선순위큐
- Python
- 1주일회고
- JavaScript
- 개발자부트캠프추천
- Spring multimodule
- 취업리부트코스
- 빈 충돌
- 단기개발자코스
- 코딩테스트 준비
- jwt
- infcon 2024
- 프로그래머스
- 빈 조회 2개 이상
- KPT회고
Archives
- Today
- Total
목록프로그래머스 이중우선순위큐 (1)
m1ndy5's coding blog
프로그래머스 이중우선순위큐 python
heap을 사용해서 푸는 문제였다. import heapq def solution(operations): answer = [] heap = [] for o in operations: op, num = o.split() if op == 'I': heapq.heappush(heap, int(num)) elif op == 'D' and num == '1': if len(heap) == 0: continue heap.remove(max(heap)) elif op == 'D' and num == '-1': if len(heap) == 0: continue heapq.heappop(heap) if len(heap) == 0: answer = [..
알고리즘 with python/알고리즘 스터디
2023. 12. 4. 11:25