Files
CodeObject/storage/zeta/kt/completed/11399.kt

14 lines
321 B
Kotlin

fun minimumTimeTaken(times: List<Int>): Int {
var total = 0;
return times.sorted().sumOf {
total += it
total
}
}
fun main() = with(System.`in`.bufferedReader()) {
readLine()
val times = this.readLine().split(' ').map { it.toInt() }
println(minimumTimeTaken(times))
}