Find the Minimum Average of Pairs (Beats 100%)
IntuitionThe goal seems to be to find the minimum possible average of pairs of numbers, where we are pairing the smallest number with the largest, the second sm
# Intuition
The goal seems to be to find the minimum possible average of pairs of numbers, where we are pairing the smallest number with the largest, the second smallest with the second largest, and so on.

# Approach
You first sort the input list nums. This is a reasonable approach, as pairing the smallest with the largest gives a good way to minimize the average.

Then, you loop through half of the sorted list (n // 2), calculating the average of the smallest and the largest remaining numbers.

The pair with the minimum average is tracked in ans.


# Complexity
Time Complexity: Sorting the list takes 𝑂(𝑛log𝑛)
O(nlogn), and iterating through half of the list takes 𝑂(𝑛)
O(n). The overall time complexity is dominated by the sorting step, so it is O(nlogn).

Sorting: The sorting algorithm requires 𝑂(log𝑛) space due to the recursive nature of Timsort.

Variables: The other variables used in the function (such as i, j, ans, etc.) require constant space, so they don't affect the space complexity.

# Code
```python3 []
class Solution:
    def minimumAverage(self, nums: List[int]) -> float:
        ans = float('inf')
        n = len(nums)
        nums.sort()
        i = 0
        j = n-1
        for i in range(n//2):
            if((nums[i]+nums[j])/2<ans):
                ans = (nums[i]+nums[j])/2
            i += 1
            j -= 1
        return ans






        
```
['Python3']