#include using namespace std; int main(){ int n; cin >> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } sort(a.begin(), a.end()); int min = 1000000; for(int i = 0; i < n - 1; i++){ int diff = abs(a[i] - a[i + 1]); if(diff < min) min = diff; } cout << min; // your code goes here return 0; }