링크드리스트2 [프로그래머스] 프린터 (42587)(Kotlin) 원본 문제 : https://programmers.co.kr/learn/courses/30/lessons/42587?language=kotlin import java.util.* data class Doc (val priority: Int, val idx: Int) class Solution { fun solution(priorities: IntArray, location: Int): Int { var answer = 1 val printList: LinkedList = LinkedList() for ( i in priorities.indices) printList.add(Doc(priorities[i], i)) while(printList.size > 1) { val firstDoc: Doc = pri.. 2020. 1. 13. [프로그래머스] 다리를 지나는 트럭(42583)(Kotlin) 원본 문제 : https://programmers.co.kr/learn/courses/30/lessons/42583 2020/01/13 import java.util.* class Solution { fun solution(bridge_length: Int, weight: Int, truck_weights: IntArray): Int { var answer = 0 val truckQueue: Queue = LinkedList(truck_weights.toList()) val bridgeQueue: Queue = LinkedList() val bridgeProgessQueue: Queue = LinkedList() bridgeQueue.add(truckQueue.poll()) bridgeProgessQue.. 2020. 1. 13. 이전 1 다음