JAVA || EASIEST SOLUTION
IntuitionApproachComplexity

Time complexity:
O(nlogn)


Space complexity:
O(n)

Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
O(nlogn)

- Space complexity:
O(n)

# Code
```java []
import java.util.Arrays;

class Solution {
    public double minimumAverage(int[] nums) {
        // Use a double array to store floating-point averages
        double[] arr = new double[nums.length / 2];

        // Sort the array
        Arrays.sort(nums);

        int i = 0;
        int j = nums.length - 1;
        int index = 0;

        // Initialize min as the maximum possible value
        double min = Double.MAX_VALUE;

        // Calculate averages and find the minimum
        while (i < j) {
            double avg = (nums[i] + nums[j]) / 2.0; // Use 2.0 for floating-point division
            arr[index] = avg; // Store the average in the double array
            min = Math.min(min, avg); // Update min
            index++;
            i++;
            j--;
        }

        return min;
    }
}

```
['Java']