题目描述
Least Distance
Mr. John has a habit of implementing new programming methods. This time he needs your help to solve a problem. He needs a method such that it accepts a series of numbers (all in single digits) and returns a typical answer. The answer must be the least distance between any two ADJACENT numbers.
For Example: If the series of numbers submitted is :4 8 6 1 2 9 4 The output must yield '1' since the least difference between 2 neighbouring numbers is 1 i.e between 1 and 2.
Note that order of numbers do not matter. In above example, 2 may have appeared before 1.
Neglect if the difference is a negative number.
Input
First line of input must contain a series of numbers.
All numbers must be between 0 and 9 i.e. single digits.
Output
Second Line is the output of the given input.
Example
Input:
4 8 6 1 2 9 4
Output:
1
Input:
5 7 4 9 7 2
Output:
2
输入格式
见题面
输出格式
见题面