Rust/Python sort and take one from each side
Intuition\n\nTo find minimum maximum fast, sort the values and take from each side.\n\n# Complexity\n- Time complexity: $O(n \log n)$\n- Space complexity: $O(1)
# Intuition\n\nTo find minimum maximum fast, sort the values and take from each side.\n\n# Complexity\n- Time complexity: $O(n \\log n)$\n- Space complexity: $O(1)$\n\n# Code\n```Python []\nclass Solution:\n  def minimumAverage(self, nums: List[int]) -> float:\n    nums.sort()\n    res = float(\'inf\')\n    for i in range(len(nums) // 2):\n      tmp = (nums[i] + nums[len(nums) - i - 1]) / 2.\n      res = min(res, tmp)\n    return res\n        \n```\n```Rust []\nimpl Solution {\n  pub fn minimum_average(mut nums: Vec<i32>) -> f64 {\n    nums.sort_unstable();\n    let mut res = i32::MAX;\n    for i in 0 .. nums.len() / 2 {\n      res = res.min(nums[i] + nums[nums.len() - 1 - i]);\n    }\n    return (res as f64) / 2.;\n  }\n}\n```
['Python3', 'Rust']