1491. Average Salary Excluding the Minimum and Maximum Salary

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1491

class Solution:
    def average(self, salary: List[int]) -> float:
        s = sum(salary) - min(salary) - max(salary)
        return s / (len(salary) - 2)