파이썬 코딩테스트/프로그래머스
프로그래머스 / 프린터 / 파이썬
S.T.Lee
2022. 9. 14. 12:57
def solution(priorities, location):
num_list = [(i,p) for i,p in enumerate(priorities)]
answer = 0
while True:
current = num_list.pop(0)
if any(current[1]<i[1] for i in num_list):
num_list.append(current)
else:
answer += 1
if current[0] == location:
break
return answer