Kotlin Two pointer
ApproachOnce list is sorted, we get min value at 0 index and max value at last index, Now we can use two pointer to get an average.Complexity
Time complexity: O

# Approach
<!-- Describe your approach to solving the problem. -->
Once list is sorted, we get min value at 0 index and max value at last index, Now we can use two pointer to get an average.

# Complexity
- Time complexity: O(NLogN)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```kotlin []
class Solution {
    fun minimumAverage(nums: IntArray): Double {
        nums.sort()
        var left = 0 
        var right = nums.size-1
        var avg = Double.MAX_VALUE
        while(left<right){
            var v : Double = (nums[left] + nums[right])/2.toDouble();
            avg = Math.min(avg, v)
            left++
            right--
        }
		return avg

    }
}
```
['Kotlin']