Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 441 Bytes

File metadata and controls

22 lines (18 loc) · 441 Bytes

Span Of Array

Easy


  1. You are given a number n, representing the count of elements.
  2. You are given n numbers.
  3. You are required to find the span of input.
  4. Note: Span is defined as difference of maximum value and minimum value.

Example 1:

Input:  6 15 30 40 4 11 9
Output:  36

Constraints:

1 <= n <= 10^4
0 <= n1, n2
 .. n elements <= 10 ^9