1619. Mean of Array After Removing Some Elements
On This Page
class Solution:
def trimMean(self, arr: List[int]) -> float:
n = len(arr)
start, end = int(n * 0.05), int(n * 0.95)
arr.sort()
t = arr[start:end]
return round(sum(t) / len(t), 5)