You are viewing a single comment's thread. Return to all comments →
Kotlin answer to match all tests
fun miniMaxSum(arr: Array<Int>): Unit { val sorted = arr.map { it.toLong() }.sorted() val min:Long = (sorted.take(4).sum()).toLong() val max:Long = (sorted.takeLast(4).sum()).toLong() println("$min $max") }
Seems like cookies are disabled on this browser, please enable them to open this website
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
Kotlin answer to match all tests