Leetcode 1210 Solution
This article provides solution to leetcode question 1210 (mean-of-array-after-removing-some-elements)
Access this page by simply typing in "lcs 1210" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/mean-of-array-after-removing-some-elements
Solution
class Solution:
def trimMean(self, arr: List[int]) -> float:
arr.sort()
bound = len(arr) // 20
i = bound
return sum(arr[bound:-bound]) / len(arr[bound:-bound])