LeetCode solutions

1584. Average Salary Excluding the Minimum and Maximum Salary

My accepted Python solution to LeetCode problem 1584, Average Salary Excluding the Minimum and Maximum Salary, running in 0ms.

  • Difficulty: Easy
  • Python
  • Runtime 0ms
  • Memory 17.5MB

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 0ms, memory 17.5MB, accepted 2025-12-29.

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

Source