반응형
Recent Posts
Notice
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 |
Tags
- Python
- 알고리즘
- BFS
- 99항해
- 파이썬
- 혁펜하임
- easy 딥러닝
- 개발자취업
- BOJ
- 큐
- 해시
- til
- 스택
- 기능개발
- 딥러닝
- 99클럽
- 구현
- 코딩테스트준비
- python 2309
- 프로그래머스
- dfs
- 백준
- boj 2309
- leetcode
- 항해99
- 코딩테스트 준비
- 개발자 취업
- 백준 2309
- 활성화 함수
- softeer
Archives
- Today
- Total
동까의 코딩
[99클럽] 37일차 TIL 본문
반응형
https://leetcode.com/problems/seat-reservation-manager/submissions/1300708018/
heap의 기본적인 동작을 나타내는 문제입니다.
from collections import deque
class SeatManager:
def __init__(self, n: int):
self.min_heapq = [i for i in range(1, n + 1)]
def reserve(self) -> int:
return heapq.heappop(self.min_heapq)
def unreserve(self, seatNumber: int) -> None:
heapq.heappush(self.min_heapq, seatNumber)
반응형
'문제 풀이 > 99클럽' 카테고리의 다른 글
[99항해] 39일차 TIL (0) | 2024.06.28 |
---|---|
[99클럽] 38일차 TIL (0) | 2024.06.28 |
[99클럽] 36일차 TIL (0) | 2024.06.25 |
[99클럽] 35일차 TIL (0) | 2024.06.25 |
[99클럽] 34일차 TIL (0) | 2024.06.23 |