Array Range

Easy · rating 900 · Arrays

The first line contains n. The second line has n integers. Print the difference between the largest and smallest (the range).

Constraints: 1 ≤ n ≤ 105, |ai| ≤ 109

Related problems

Open Array Range in Code Arena →