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()); var myListTest = Console.ReadLine().Split(' '); var myList = new List(); for (int i = 0; i < myListTest.Length; i++) { myList.Add(Convert.ToInt32(myListTest[i])); } myList.Sort(); int min = Int32.MaxValue; for (int i = 0; i < myList.Count-1; i++) { int abs = Math.Abs(myList[i] - myList[i+1]); if (abs < min) { min = abs; } } Console.WriteLine(min); } }