#include using namespace std; int findMinDiff(int arr[], int n) { sort(arr, arr+n); // Initialize difference as infinite int diff = INT_MAX; // Find the min diff by comparing adjacent // pairs in sorted array for (int i=0; i> n; int a[n]; for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } cout << findMinDiff(a, n); return 0; }