Math.min, Array.sort
Intuition\nSorting, and then calculate avg. It isn\'t neecesary track avegerates, only the smallest.\n\n# Complexity\n- Time complexity: O(n / 2)\n- Space compl
# Intuition\nSorting, and then calculate avg. It isn\'t neecesary track avegerates, only the smallest.\n\n# Complexity\n- Time complexity: $$O(n / 2)$$\n- Space complexity: $$O(1)$$\n\n# Code\n```\nfunction minimumAverage(nums: number[]): number {\n    nums.sort((a, b) => a - b)\n\n    let min = 50\n\n    for (let i = 0; i < Math.ceil(nums.length / 2); i++) {\n        const avg = (nums[i] + nums[nums.length - 1 - i]) / 2\n        min = Math.min(min, avg)\n    }\n\n    return min\n};\n```
['TypeScript']