Problems/1491. (E) Average Salary Excluding the Minimum and Maximum Salary/Java/solution_2.java
<filename>Problems/1491. (E) Average Salary Excluding the Minimum and Maximum Salary/Java/solution_2.javaclass Solution {
  public double average(int[] salary) {
  // sort

  Arrays.sort(salary);
  return (double) Arrays.stream(salary, 1, salary.length-1).sum() / (salary.length-2);
  }
}
