
Given an array of integers, compute the absolute difference between the largest and smallest values present in the collection. The spread is defined as the result of subtracting the minimum value from the maximum value.
Explanation: The maximum element is 21 and the minimum element is 3. The spread is 21 - 3 = 18.
Explanation: Both the maximum and minimum elements are 7. The spread is 7 - 7 = 0.
Explanation: The maximum element is 50 and the minimum element is -10. The spread is 50 - (-10) = 60.
Access the full code editor, ThinkBuddy AI hints, and track your progress.