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 = int.MaxValue; for (int i = 0; i < a.Length - 1; i++) { min = Math.Min(min, Math.Abs(a[i] - a[i+1])); } Console.WriteLine(min); } }