about | help | code help+videos | done | prefs |
Write a method called almostAverage which receives an array of integers as an input and returns the average of the array of integers without the maximum or minimum values of the array included in the average. For example if almostAverage was passed the array [2,4,200, 6] the largest and smallest values are ignored and the average would be calculated as 5.0 ( (4+6)/2 ). almostAverage([2, 4, 200, 6]) → 5.0 almostAverage([1, 500, 10, 11, 12]) → 11.0 almostAverage([300, 20, 30, 40, 50, 60, -3]) → 40.0 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy