easy way using while loop
IntuitionApproachComplexity
Time complexity:

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

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

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

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

# Code
```dart []
class Solution {
  double minimumAverage(List<int> nums) {
    List<double> newVal=[];
    nums.sort();
  
while(nums.length>1)
{
  int first = nums.first;
  int last = nums.last;
  
  newVal.add((first+last)/2);
  
  nums.removeAt(0);
  nums.removeLast();
  
}
  newVal.sort((a,b)=> a.compareTo(b));
  return newVal.first;
 
  }
  
}
```
['Dart']