import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Comparator c = new Comparator() { @Override public int compare(Integer o1, Integer o2) { if(o1.intValue() < o2.intValue()) return -1; else if(o1.intValue() == o2.intValue()) return 0; else return 1; } }; Scanner in = new Scanner(System.in); int n = in.nextInt(); ArrayList list = new ArrayList(); for(int a_i=0; a_i < n; a_i++){ int t = in.nextInt(); list.add(t); } list.sort(c); int mindif = Integer.MAX_VALUE; for(int i = 0; idif) mindif = dif; } System.out.println(mindif); } }