using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] a_temp = Console.ReadLine().Split(' '); int[] a = Array.ConvertAll(a_temp,Int32.Parse); // your code goes here Array.Sort(a); int min = Math.Abs(a[0] - a[1]); for (int i = 0; i < n-1; i++) { int x = Math.Abs(a[i] - a[i + 1]); min = x < min ? x : min; } Console.WriteLine(min); } }