Problem

Remove one occurrence of the min and one of the max, then return the integer average of the remaining values.

Examples

  • avgWithoutExtremes([2, 4, 6, 8, 40]) -> 6
  • avgWithoutExtremes([5, 5, 5]) -> 5
  • avgWithoutExtremes([10, 1, 2, 3]) -> 2
Compile and test (Ctrl+Enter)