💯💯All Approaches-->Recursive✔✔Two Pointer✔✔ Using STL✔✔
IntuitionSimple and Easy...1st methodCode2nd methodCode3rd method- recursiveCode
# Intuition
Simple and Easy...
# 1st method
# Code
```cpp []
class Solution {
public:
    double minimumAverage(vector<int>& nums) {
        vector<double> arr;
        sort(nums.begin(),nums.end());
        int i=0,j=nums.size()-1;
        while(i<j){
            double k=double(nums[i]+nums[j])/2.0;
           arr.push_back(k);
           i++;
           j--; 
        }
        return *min_element(arr.begin(),arr.end());
    }
};
```

# 2nd method
# Code
```cpp []
class Solution {
public:
    double minimumAverage(vector<int>& nums) {
        vector<double> arr;
         while(!nums.empty()){
             int c=*min_element(nums.begin(),nums.end());
             int k=*max_element(nums.begin(),nums.end());
             arr.push_back(double(c+k)/2.0);
             nums.erase(find(nums.begin(),nums.end(),c));
             nums.erase(find(nums.begin(),nums.end(),k));
         }
         return *min_element(arr.begin(),arr.end());
    }
};
```


# 3rd method- recursive
# Code
```cpp []
class Solution {
public:
    double recursive(vector<int>& nums, int i, int j, double m) {
        if(i>=j) return m;
        double avg=(double(nums[i])+nums[j])/2.0;
        m = min(m,avg);
        return recursive(nums,i+=1,j-=1,m);
    }

    double minimumAverage(vector<int>& nums) {
        sort(nums.begin(), nums.end());
        return recursive(nums,0,nums.size()-1,DBL_MAX);
    }
    
};
```


['Two Pointers', 'Recursion', 'Sorting', 'C++']