You are viewing a single comment's thread. Return to all comments →
Scala
def miniMaxSum(arr: Array[Int]) { // Write your code here val sortedArray = arr.sorted val min = sortedArray(0) + sortedArray(1) + sortedArray(2) + sortedArray(3) val max = sortedArray(4) + sortedArray(1) + sortedArray(2) + sortedArray(3) println(s"$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 →
Scala