Average Salary Excluding the Minimum and Maximum Salary Problem
Average Salary Excluding the Minimum and Maximum Salary Problem — ExecCode Easy DSA Practice
Solve the Average Salary Excluding the Minimum and Maximum Salary problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given an array of unique integers salary where salary[i] is the salary of the i^th employee. Your task is to compute the required answer and return the average salary of employees excluding the minimum and maximum salary. Answers within 10^-5 of the actual answer will be accepted.
Examples
Input {"salary": [4000, 3000, 1000, 2000]}; Output 2500.0. Input {"salary": [1000, 2000, 3000]}; Output 2000.0
Constraints
3 <= salary.length <= 100 1000 <= salary[i] <= 10^6 All the integers of salary are unique.
Practice Average Salary Excluding the Minimum and Maximum Salary free on ExecCode. Browse DSA problems, topic map, and placement guides.