Trimmed Mean
Ignore every value in nums that is below low or above high, and return the average of the values that are left (a float). At least one value is inside the range low to high.
Example 1
nums [1,50,60,1000]
low 10
high 100
returns 55.0
Only 50 and 60 are kept; their average is 55.0.
Constraints
1 <= len(nums) <= 100- At least one value is between
lowandhigh(inclusive)
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Vector DistanceEasy
- Weighted AverageEasy
- Weighted Row ScoresEasy
- Whole DollarsEasy
- Z-ScoresEasy
- Zero PositionsEasy
- Best Columns of Each RowMedium
- Cells Above Row AverageMedium