You are viewing a single comment's thread. Return to all comments →
Kotlin Solution
fun miniMaxSum(arr: Array<Int>): Unit { val sum = arr.sumOf { it.toLong() } arr.sort() val maxSum = sum - arr.first() val minSum = sum - arr.last() print("$minSum $maxSum") }
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 Solution