You are viewing a single comment's thread. Return to all comments →
Java Code:
public static void miniMaxSum(List<Integer> arr) { // Write your code here Collections.sort(arr); long sum=0, min=0, max=0; for(Integer e : arr) { sum = sum + e; } min = sum - arr.get(4); max = sum - arr.get(0); System.out.print(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 →
Java Code: