Problem

Return the difference between the largest and smallest values in the array.

Examples

  • minMaxDiff([12, 5, 9, 20]) -> 15
  • minMaxDiff([3, 3, 3]) -> 0
  • minMaxDiff([100, 1]) -> 99
Compile and test (Ctrl+Enter)