LeetCode --- 1619. Mean of Array After Removing Some Elements 解题报告
Posted 杨鑫newlfe
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 1619. Mean of Array After Removing Some Elements 解题报告相关的知识,希望对你有一定的参考价值。
Given an integer array arr
, return the mean of the remaining integers after removing the smallest 5%
and the largest 5%
of the elements.
Answers within 10-5
of the actual answer will be considered accepted.
Example 1:
Input: arr = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3]
Output: 2.00000
Explanation: After erasing the minimum and the maximum values of this array, all elements are equal to 2, so the mean is 2.
Example 2:
以上是关于LeetCode --- 1619. Mean of Array After Removing Some Elements 解题报告的主要内容,如果未能解决你的问题,请参考以下文章
LeetCode - 22. Generate Parentheses
LeetCode - 31. Next Permutation