import java.util.Arrays; import java.util.Scanner; public class Solution { public static void main(String arg[]) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int vet[] = new int[n]; for(int i = 0; i < n; i++) { vet[i] = in.nextInt(); } Arrays.sort(vet); int minDist = Integer.MAX_VALUE; for(int i = 0; i < n-1; i++) { minDist = Math.min(minDist, Math.abs(vet[i] - vet[i+1])); } System.out.println(minDist); } }