[Python] 프로그래머스 - 이중우선순위큐

programmers.co.kr/learn/courses/30/lessons/42628 코딩테스트 연습 - 이중우선순위큐 programmers.co.kr 기본 heapq문제이다. 파이썬에서 '우선순위큐'를 사용하려면 priorityQueue가 아닌 heapq를 사용해야한다. import heapq def solution(operations): # 힙 정렬 def heap_sort(nums): heap = [] for num in nums: heapq.heappush(heap, num) sorted_nums = [] while heap: sorted_nums.append(heapq.heappop(heap)) return sorted_nums h = [] for o in operations: op = o.s..