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); int min = 2147483647; // your code goes here Array.Sort(a); for(int i = 0; i < n-1; i++){ int diff = a[i] - a[i+1]; if(diff < 0){ diff *= -1; } if(diff < min){ min = diff; } } Console.WriteLine(min); } }