import * as fs from 'fs'; const input = fs.readFileSync('/dev/stdin', 'utf8'); const [NStr, xArrStr] = input.split('\n'); const N = parseInt(NStr); const xs = xArrStr.split(' ').map(s => parseInt(s)); if (N === 1) { console.log(0); } else { let min = 1000000; for (let i = 1; i < xs.length; i++) { min = Math.min(min, Math.abs(xs[i - 1] - xs[i])); } console.log(min); }