Leetcode 1491: Average Salary Excluding the Minimum and Maximum Salary

Pierre-Marie Poitevin
1 min readJun 28, 2020

In this Leetcode problem, we try to compute the average of an array excluding max the max and min value.

Problem statement

Solution

A couple of ideas for the solution:

  • Go through the array and keep track of the sum of all elements but the current min and max
  • At each step we can…

--

--