import java.util.Arrays;

public class Arraz {



    public Boolean checkingForNull(String[] arr){

       Boolean flag = null;


        for (int i = 0; i < arr.length ; i++) {
            if(arr[i] == null){

                return flag = true;
            }else{
                 flag = false;
            }

        }

        return flag;


    }


    public Integer sumValuesOfArrayInt(Integer[] arr) {

        int value = 0;

        for (int i = 0; i < arr.length; i++) {
            value += arr[i];
        }

        return value;
    }

    public double sumValuesOfArrayDouble(double[] arr) {
        int value = 0;

        for(double a : arr)

            value += a;

        return value;
    }

    public Integer getTheAvgInt(Integer[] arr) {

        int value = sumValuesOfArrayInt(arr);

        int avg = value / arr.length ;

        return avg;
    }

    public double getTheAvgDoub(double[] arr) {

        double value = sumValuesOfArrayDouble(arr);

        value = value / arr.length ;

        return value;
    }


    public static long theFibonacci(long i){

        if(i == 0){
            return 0;
        }else if(i <= 2){
            return 1;
        }
       return theFibonacci(i - 1) + theFibonacci(i - 2);


    }

    public Boolean containsValue(Integer [] arr, int value) {

        Boolean flag = null;

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


            if (arr[i] == value) {
                return flag = true;
            }
        }
        return flag = false;


    }

    public Integer[] reverseAnArray(Integer [] arr){

        Integer [] arr2 = new Integer[arr.length];
        int counter = 0;

        for (int i = arr.length-1; i >= 0; i--) {

            if(arr[i] != null) {
                arr2[counter] = arr[i];
                counter++;

            }


        }

        return  arr2;

    }





}
