import java.rmi.NotBoundException;

public class MinMax1 {

    static class MinMax {
        public int min;
        public int max;
    }

    static MinMax findMaxnMin(Integer [] arr){
        MinMax minmax = new MinMax();

        if(arr.length == 1){
            minmax.max = arr[0];
            minmax.min = arr[0];

            return minmax;
        }


        if(arr[0] > arr[1]){

            minmax.max = arr[0];
            minmax.min = arr[1];

        }else{

            minmax.max = arr[1];
            minmax.min = arr[0];
        }

        for (int i =2; i < arr.length; i++) {

            if(arr[i] > minmax.max) {
                minmax.max = arr[i];

            }
            else if(arr[i] < minmax.min){

                minmax.min = arr[i];
            }
        }

        return minmax;
    }


    public int averageArrayWithoutMaxMin(){
        return 0;
    }
}


