You are viewing a single comment's thread. Return to all comments →
Another approach but not all test cases are passing.
def miniMaxSum(arr: Array[Int]) { // Write your code here var min: Long = 0 var max: Long = 0 var sortedNum = arr.sorted print(sortedNum.take(4).sum) print(" ") print(sortedNum.takeRight(4).sum) }
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 →
Another approach but not all test cases are passing.