-->https://programmers.co.kr/learn/courses/30/lessons/42587
from collections import deque
def solution(priorities, location):
answer = 1
queue= deque()
for priority in priorities:
queue.append([priority,0])
queue[location][1] = 1
print(queue)
while queue:
priority,loc = queue.popleft()
if priority >= max(priorities):
if loc == 1:
return answer
elif loc == 0:
answer +=1
priorities.remove(max(priorities))
else:
queue.append([priority,loc])
return answer