1차 시도 def solution(scoville, K): answer = 0 while True: scoville.sort() if scoville[0]==0 and scoville[1]==0: return -1 min1=scoville.pop(0) min2=scoville.pop(1) mixed=min1+min2*2 scoville.insert(0,mixed) answer+=1 if min(scoville)>=K: break return answer Heap에 관한 설명 https://gmlwjd9405.github.io/2018/05/10/data-structure-heap.html [자료구조] 힙(heap)이란 - Heee's Development Blog Step by step goes a lo..