• + 0 comments

    Java 15 Solution:

    public static void miniMaxSum(List<Integer> arr) {
        // Write your code here
        Integer min=Collections.min(arr);
        Integer max=Collections.max(arr);
        Long sumLong=0L;
        for (Integer integer : arr) {
            sumLong+=integer;
        }
        System.out.print(sumLong-max+" ");
        System.out.print(sumLong-min);
    
        }