You are viewing a single comment's thread. Return to all comments →
Kotlin Solution:
fun miniMaxSum(arr: Array<Int>) { val longArr = arr.map { it.toLong() } val totalSum = longArr.sum() val minSum = totalSum - longArr.maxOrNull()!! val maxSum = totalSum - longArr.minOrNull()!! println("$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: