EASIEST JAVA SOLUTION
Intuition\nsort and update\n\n# Approach\nsort and update\n\n# Complexity\n- Time complexity:\nO(NLogN)\n\n- Space complexity:\nO(1)\n\n# Code\n\nclass Solution
# Intuition\nsort and update\n\n# Approach\nsort and update\n\n# Complexity\n- Time complexity:\nO(NLogN)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\n    public double minimumAverage(int[] nums) {\n        Arrays.sort(nums);\n        double minElement = Double.MAX_VALUE;\n        int i = 0;\n        int j = nums.length-1;\n        double avg;\n        while(i < j){\n            avg = ((double) nums[i] + nums[j])/2;\n            if(avg < minElement){\n                minElement = avg;\n            }\n            i++;\n            j--;\n        }\n        return minElement;\n    }\n}\n```
['Java']