Leetcode 1491: Average Salary Excluding the Minimum and Maximum Salary
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.
Solution
A couple of ideas for the solution:
- Go through the array and keep track of the
sum
of all elements but the currentmin
andmax
- At each step we can…