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