We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Arrays.sort(arr);
final BigInteger minValue = BigInteger.valueOf(arr[0]+arr[1]+arr[2]+arr[3]);
final BigInteger maxValue = BigInteger.valueOf(arr[1]+arr[2]+arr[3]+arr[4]);
System.out.println(minValue+" "+maxValue);
//unless you count the Arrays.sort as an iteration.
Cookie support is required to access HackerRank
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 →