title: Find Minimum Difference Pair 1
signature: function findMinimumDifferencePair1($arr, $n) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($arr, $n, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($arr, $n), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        array(3, 25, 44, 46, 54, 60, 81), 3, 
        19));
      
      printf("TEST-1...%s\n",driver(
        array(82, 68, -98, -66, -36, -42, 98, -38, 58, -6, -28, 70, -24, 18, 16, 10, 92, 44, 28, -96, -72, 24, 28, -80, -4, 38, 88, 76), 22, 
        0));
      
      printf("TEST-2...%s\n",driver(
        array(1, 1, 1), 2, 
        0));
      
      printf("TEST-3...%s\n",driver(
        array(87, 25, 80, 45, 44, 20, 48, 47, 51, 54, 68, 47, 89, 95, 15, 29, 5, 45, 2, 64, 53, 96, 94, 22, 23, 43, 61, 75, 74, 50), 15, 
        0));
      
      printf("TEST-4...%s\n",driver(
        array(-74, -48, -42, -26, -16, -12, 0, 4, 8, 18, 46, 46, 62, 70, 74, 88, 92, 96, 98), 18, 
        0));
      
      printf("TEST-5...%s\n",driver(
        array(0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0), 36, 
        0));
      
      printf("TEST-6...%s\n",driver(
        array(27, 42, 59, 80), 2, 
        15));
      
      printf("TEST-7...%s\n",driver(
        array(-96, -94, 10, -36, 18, -40), 4, 
        2));
      
      printf("TEST-8...%s\n",driver(
        array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1), 12, 
        0));
      
  }
  
  main();
  ?>
source_py: def find_minimum_difference_pair_1(arr, n):
      arr = sorted(arr)
      diff = (10 ** 20)
      for i in range((n - 1)):
          if ((arr[(i + 1)] - arr[i]) < diff):
              diff = (arr[(i + 1)] - arr[i])
      return diff
source_cpp: int find_minimum_difference_pair_1(vector<int> arr, int n) {
    sort(arr.begin(), arr.end());
    int diff = INT_MAX;
    for ( int i = 0;
    i < n - 1;
    i ++ ) if ( arr [ i + 1 ] - arr [ i ] < diff ) diff = arr [ i + 1 ] - arr [ i ];
    return diff;
  }