-->
当前位置:首页 > 题库

PROGRAMMING:Little l's problem

Luz5年前 (2021-05-10)题库415
Recently, small l encountered a problem, please help him.
Given the number of $$n $, please find out the second smallest difference between any two different numbers in the sequence$$ a_ I $$and $$a_ The difference value of J $$is defined as $$| a_ i-a_ J | $, that is, the absolute value of the difference between two numbers, where $$I $$and $$J $$are different from each other( The second small number is the second number after sorting from small to large)
###Input format:
The first line is a positive integer $$n $$($$3 / Le n / Le 10 ^ 5 $$), which represents the length of the array.
The next line contains $$n $$integers $$a_ i$$($$-10^9\le a_ i \le 10^9$$)。
###Output format:
Output a number that represents the second smallest difference between any two different numbers in the sequence.
###Example 1
####Sample input
```in
six
11 4 7 1 16 2
```
####Sample output
```out
two
```
###Example 2
####Sample input
```in
six
10 1 2 4 15 6
```
####Sample output
```out
two
```
###Example 3
####Sample input
```in
six
6 8 10 4 3 2
```
####Sample output
```out
one
```






answer:If there is no answer, please comment