heap1 [프로그래머스] Lv3 문제풀이7(feat. JAVA) 디스크 컨트롤 import java.util.*; import java.util.stream.IntStream; class Solution { class Job { int start; int cost; Job(int start, int cost) { this.start = start; this.cost = cost; } } public int solution(int[][] jobs) { int answer = 0; PriorityQueue heap = new PriorityQueue((o1, o2) -> { if(o1.start != o2.start) return o1.start - o2.start; else return o1.cost - o2.cost; }); IntStream.range(0, jobs.. 2023. 10. 13. 이전 1 다음 728x90 반응형