1619. Mean of Array After Removing Some Elements Solution 1 (time O(n), space O(n)) class Solution(object): def trimMean(self, arr): """ :type arr: List[int] :rtype: float """ arr.sort() n = len(arr) return sum(arr[n // 20: -n // 20]) / float(n * 0.9)