beats 100%  0ms runtime
\n\n# Approach\n1-> sort the array nums\n2-> use two pointers to denote min(i) and max(j)\n3-> move these pointers(i++ and j--) till they cross each other\n4-> 
\n\n# Approach\n1-> sort the array nums\n2-> use two pointers to denote min(i) and max(j)\n3-> move these pointers(i++ and j--) till they cross each other\n4-> calculate avg((arr[i]+arr[j])/2) \n5-> store the average in min heap priority queue\n6-> return the value stored on the top of our priority queue\n\n# Complexity\n- Time complexity:\nO(nlogn)+O(nlogn)+O(1)=O(nlogn)\n\n- Space complexity:\nO(n)\n\n# Code\n```\nclass Solution {\npublic:\n    double minimumAverage(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        priority_queue <double, vector<double>, greater<double>> q;\n        int i=0,j=nums.size()-1;\n        while(i<j){\n            double avg=(((double)nums[i]+nums[j])/2);\n            q.push(avg);\n            i++;\n            j--;\n        }\n        return q.top();\n    }\n};\n```
['Array', 'Two Pointers', 'Sorting', 'Heap (Priority Queue)', 'C++']