Minimal Approach | Two pointers
ApproachSort the Numbers: Arrange the numbers in ascending order.Start with the Biggest Number: Assume the largest number is the minimum average (for now).Compa
# Approach
**Sort the Numbers:** Arrange the numbers in ascending order.

**Start with the Biggest Number:** Assume the largest number is the minimum average (for now).

**Compare Averages:**
-    Take numbers from the start (left) and end (right) of the array.
-    Calculate their average and check if it's smaller than the current minimum.
-    Move inward: increase left and decrease right to check the next pair.

**Return the Smallest Average:** After checking all pairs, the smallest average is returned.
# Complexity
- Time complexity: O(NLogN) 
- Space complexity: O(1)
 
# Code
```java []
class Solution {
    public double minimumAverage(int[] nums) {
        Arrays.sort(nums);
        int left = 0, right = nums.length-1;
        double average = nums[right];
        while(left < right)
            average = Math.min(((nums[left++]+nums[right--])/2D) , average); 
        return average;
    }
}
```
['Two Pointers', 'Java']