Summer/Winter Coding(~2018)
-
[프로그래머스][Summer/Winter Coding(~2018)][Kotlin]배달프로그래머스 2023. 2. 8. 21:51
class Solution { var townMap = mutableMapOf() var townTime = mutableMapOf() private var timeMap = mutableMapOf() fun solution(N: Int, road: Array, k: Int): Int { var answer = 0 var visited = BooleanArray(N+1){true} road.forEach{ var tempList = mutableListOf() tempList.add(it[0]) tempList.add(it[1]) tempList.sort() if(townMap.containsKey(it[0])){ var temp = townMap.get(it[0])!! temp.add(it[1]) te..