Easy to Understand👍 || C++ easy best solution   || Only one variable as pointer
Intuition\n Describe your first thoughts on how to solve this problem. \nUsing basic of sorting and two pointer algorithm.\n\n# Approach\n Describe your approac
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nUsing basic of sorting and two pointer algorithm.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nSort the array.\nThen first and last element of array will represent smallest and largest element of the array which is required to find average.\nFind sum of the elements and multiply by (1/2) or 0.5\nand mini is used to keep track of finding minimum element.\n\ni-variable is used to iterate the array as well as to keep track of first element and last element or (n-i-1)th element.\n\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N logN) + O(N) = O(N logN)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    double minimumAverage(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int n=nums.size();\n        int i=0;\n        double mini=INT_MAX;\n        while(i<n){\n            double avg= (nums[i] + nums[n - i - 1]) * 0.5;\n            mini=min(mini,avg);\n            i++;\n        }\n        return mini;\n    }\n};\n```
['Array', 'Math', 'Two Pointers', 'C', 'C++']