Best Solution in java
IntuitionThe problem requires finding the minimum average of two numbers in the array. By sorting the array first, we can easily identify the smallest pairs tha
# Intuition
The problem requires finding the minimum average of two numbers in the array. By sorting the array first, we can easily identify the smallest pairs that contribute to the minimum average.

# Approach
1. Sort the given array.
2. Iterate through the first half of the array and pair each element with its corresponding element from the other end.
3. Compute the average of each pair and track the minimum found.
4. Return the minimum average.

# Complexity
- Time complexity: O(n log n) (due to sorting).

- Space complexity: O(1) (only a few extra variables used)

# Code
```java []
class Solution {
    public double minimumAverage(int[] nums) {
        Arrays.sort(nums);
        double min= Integer.MAX_VALUE;
        for(int i=0;i<nums.length/2;i++){   
            min= Math.min((double)(nums[i]+nums[nums.length-1-i])/2,min);
        }
        return min;
        
    }
}
```
['Java']