You are given an array of unique integers salary where salary[i] is the salary of the ith employee.
Return the average salary of employees excluding the minimum and maximum salary. Answers within 10^-5 of the actual answer will be accepted.

class Solution {
public double average(int[] salary) {
ArrayList<Integer> sal = new ArrayList<>();
for (int i : salary) sal.add(i);
Collections.sort(sal);
int sum = 0;
System.out.println(sal);
for (int j = 1; j < sal.size() - 1; j++) {
sum += sal.get(j);
}
return sum / (double) (sal.size() - 2);
}
}