All prompts are owned by LeetCode. To view the prompt, click the title link above.
Completed during Weekly Contest 403 (q1)
First completed : July 07, 2024
Last updated : July 07, 2024
Related Topics : Array, Two Pointers, Sorting
Acceptance Rate : 84.65 %
class Solution:
def minimumAverage(self, nums: List[int]) -> float:
nums = deque(sorted(nums))
output = []
while nums :
output.append((nums.popleft() + nums.pop()) / 2)
return min(output)