힙
Programmers :: Heap(힙) 더 맵게 레벨2
풀이 import java.util.Arrays; import java.util.PriorityQueue; import java.util.stream.Collectors; class Solution{ public int solution(int[] scoville, int K){ int count = 0; int firstLowest; int secondLowest; int combinedTwoLowestFoods; PriorityQueue priorityQueueLowest = new PriorityQueue(Arrays.stream(scoville).boxed().collect(Collectors.toList())); while(true){ if(priorityQueueLowest.size() == 1..
728x90