class Solution {
public double average(int[] salary) {
Arrays.sort(salary);
salary[0] = 0;
for(int i = 1;i < salary.length - 1;i++){
salary[0] += salary[i];
}
return salary[0] * 1.0 / (salary.length - 2);
}
}