Skip to content

Commit

Permalink
Time: 4 ms (30.04%), Space: 7.2 MB (40.43%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
prakhar-1005 committed Jun 30, 2022
1 parent 6bdfca5 commit 7069089
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Solution {
public:
double average(vector<int>& salary) {
sort(salary.begin(),salary.end());
double avg=0;

for(int i=1;i<salary.size()-1;i++)
avg=avg+salary[i];

return avg/(salary.size()-2);
}
};

0 comments on commit 7069089

Please sign in to comment.