Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1010 Bytes

_3194. Minimum Average of Smallest and Largest Elements.md

File metadata and controls

39 lines (26 loc) · 1010 Bytes

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Completed during Weekly Contest 403 (q1)

Back to top


First completed : July 07, 2024

Last updated : July 07, 2024


Related Topics : Array, Two Pointers, Sorting

Acceptance Rate : 84.65 %


Solutions

Python

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)