#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
class Solution {
public:
double average(vector<int>& salary) {
sort(salary.begin(), salary.end());
return (double)accumulate(salary.begin() + 1, salary.end() - 1, 0) / (salary.size() - 2);
}
};
int main() {
return 0;
}
#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
class Solution {
public:
double average(vector<int>& salary) {
int minv = *min_element(salary.begin(), salary.end());
int maxv = *max_element(salary.begin(), salary.end());
double sum = accumulate(salary.begin(), salary.end(), 0) - minv - maxv;
return sum / (salary.size() - 2);
}
};
int main() {
return 0;
}