스택/큐 세트에 있는 프린터 문제입니다.
https://programmers.co.kr/learn/courses/30/lessons/42587
def solution(priorities, location):
indices = list(range(len(priorities)))
priorities = list(zip(priorities, indices))
count = 0
while priorities:
j, index = priorities.pop(0)
if priorities and j < max(priorities)[0]:
priorities.append((j, index))
else:
count += 1
if location == index:
return count
raise RuntimeError()