f '프린터' 태그의 글 목록 — 하늘속에서IT

프린터

    Programmers 스택/큐::레벨2::프린터

    풀이 import java.util.* class Solution { fun solution(priorities: IntArray, location: Int): Int { val operationQ: Queue = LinkedList() val standByQ: Queue = LinkedList(priorities.mapIndexed { index, priorityValue -> PrintTarget(index, priorityValue) }) /** 설명 - operationQ(실제 실행 대기열) 와 standByQ(실행 하기전 대기열) 두개의 큐를 선언한다. - 문제의 조건에 맞추어 standByQ 에서 operationQ 로 값을 이동시킨다. */ while(standByQ.isNotEmpty())..