Mean of Array After Removing Some Elements

给一个数组, 求删除最大的5%和最小的5%后的mean.

这个居然是狗家题, 我…无语了

class Solution {
    public double trimMean(int[] arr) {
        Arrays.sort(arr);
        int n = arr.length;
        double sum = 0d;
        int count = 0;
        for(int i = (int)(n * 0.05); i < (int)(n * (1 - 0.05)); i++){
             sum += arr[i];
             count++;
        }
        return sum / count; 
    }
}