class Solution {
public:
double average(vector<int>& salary) {
vector<int> salary_date = salary;
sort(salary_date.begin(), salary_date.end());
double average_salary = 0;
for (int n = 1; n < salary_date.size()-1; n++) {
average_salary = average_salary + salary_date[n];
}
average_salary = average_salary/(salary_date.size()-2);
return average_salary;
}
};