Skip to content

Latest commit

 

History

History

minimum-average-of-smallest-and-largest-elements

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Minimum average of smallest and largest elements

Problem link

Solutions

Solution.py

# https://leetcode.com/problems/minimum-average-of-smallest-and-largest-elements/

class Solution:
    def minimumAverage(self, nums: List[int]) -> float:
        nums.sort()
        return min((x + y) / 2 for x, y in zip(nums, nums[::-1]))

Tags