분류 전체보기145 [프로그래머스] 기능개발(42586)(Kotlin) 원본 문제 : https://programmers.co.kr/learn/courses/30/lessons/42586 코딩테스트 연습 - 기능개발 | 프로그래머스 프로그래머스 팀에서는 기능 개선 작업을 수행 중입니다. 각 기능은 진도가 100%일 때 서비스에 반영할 수 있습니다. 또, 각 기능의 개발속도는 모두 다르기 때문에 뒤에 있는 기능이 앞에 있는 기능보다 먼저 개발될 수 있고, 이때 뒤에 있는 기능은 앞에 있는 기능이 배포될 때 함께 배포됩니다. 먼저 배포되어야 하는 순서대로 작업의 진도가 적힌 정수 배열 progresses와 각 작업의 개발 속도가 적힌 정수 배열 speeds가 주어질 때 각 배포마다 몇 programmers.co.kr import java.util.* class Solution .. 2020. 1. 14. [프로그래머스] 실패율 (42889)(Kotlin) 원본 문제 : https://programmers.co.kr/learn/courses/30/lessons/42889?language=kotlin class Solution { fun solution(N: Int, stages: IntArray): IntArray { var answer = IntArray(N) val frequency: MutableMap = mutableMapOf() val failureRate: MutableMap = mutableMapOf() for ( stage in stages ) { if ( frequency.containsKey(stage)) { frequency[stage] = frequency.getValue(stage) + 1 } else { frequency[stage.. 2020. 1. 14. [프로그래머스] 프린터 (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 ··· 6 7 8 9 10 11 12 ··· 37 다음