기존 리스트를 힙으로 변경하는 방법 heapify() 함수 사용하기
import heapq
def solution(scoville, K):
answer = 0
heapq.heapify(scoville)
while scoville:
food1=heapq.heappop(scoville)
if food1>=K:
return answer
if not scoville:
break
food2=heapq.heappop(scoville)
heapq.heappush(scoville,(food1+food2*2))
answer+=1
return -1