implementation of two pointers to solve this question in C++
IntuitionStep 1: Sort the Array
•	Sorting ensures that the smallest and largest elements are correctly paired.
•	Sorting helps us efficiently pair elements symm
# Intuition
Step 1: Sort the Array
	•	Sorting ensures that the smallest and largest elements are correctly paired.
	•	Sorting helps us efficiently pair elements symmetrically (first & last, second & second-last, etc.).

Step 2: Use Two Pointers (start & end)
	•	start points to the smallest element (nums[0]).
	•	end points to the largest element (nums[n-1]).
	•	We compute the average of nums[start] and nums[end] using:
\text{mid} = \frac{\text{nums[start]} + \text{nums[end]}}{2.0}
	•	Push the computed average into a vector ans.

Step 3: Move Pointers
	•	Increment start and decrement end to process the next pair.
	•	Repeat the process until start crosses end.

Step 4: Find the Minimum Average
	•	Iterate over the stored averages in ans to find the minimum.


# Complexity
- Time complexity:
	1.	Sorting the Array → O(n \log n)
	•	Sorting requires O(n \log n) time using a standard sorting algorithm like QuickSort or MergeSort.
	2.	Two-Pointer Traversal → O(n)
	•	The loop runs at most n/2 times, so it’s O(n).
	3.	Finding the Minimum in ans → O(n)
	•	A single traversal to find the minimum takes O(n).

Overall Complexity

O(n \log n) + O(n) + O(n) = O(n \log n)
Since O(n \log n) dominates, the final complexity is:
\mathbf{O(n \log n)}

- Space complexity:
	1.	Sorting → O(1)
	•	The sorting is done in place, so no extra space is used.
	2.	Vector ans Stores Mid-Values → O(n)
	•	In the worst case, we store up to n/2 values, which simplifies to O(n).

Overall Space Complexity


# Code
```cpp []
class Solution {
public:
    double minimumAverage(vector<int>& nums) {
        vector<double> ans;
        sort(nums.begin(),nums.end());
        int start=0;
        int end=nums.size()-1;
        double  mid=start+(end-start)/2;
        while(start<=end){
            double mid=nums[start]+(nums[end]-nums[start])/2.0;
            ans.push_back(mid);
            start++;
            end--;
        } 
        double mini=INT_MAX;
        for(double val : ans){
            mini=min(mini,val);

        }
        return mini;
        
    }
};
```
['Array', 'Two Pointers', 'Binary Search', 'Sorting', 'C++']