title: Find Minimum Difference Pair 1
signature: find_minimum_difference_pair_1 <- function(arr, n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(arr, n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(3L, 25L, 44L, 46L, 54L, 60L, 81L), 3L, 
          19L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(82L, 68L, -98L, -66L, -36L, -42L, 98L, -38L, 58L, -6L, -28L, 70L, -24L, 18L, 16L, 10L, 92L, 44L, 28L, -96L, -72L, 24L, 28L, -80L, -4L, 38L, 88L, 76L), 22L, 
          0L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(1L, 1L, 1L), 2L, 
          0L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(87L, 25L, 80L, 45L, 44L, 20L, 48L, 47L, 51L, 54L, 68L, 47L, 89L, 95L, 15L, 29L, 5L, 45L, 2L, 64L, 53L, 96L, 94L, 22L, 23L, 43L, 61L, 75L, 74L, 50L), 15L, 
          0L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-74L, -48L, -42L, -26L, -16L, -12L, 0L, 4L, 8L, 18L, 46L, 46L, 62L, 70L, 74L, 88L, 92L, 96L, 98L), 18L, 
          0L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(0L, 1L, 1L, 1L, 0L, 1L, 1L, 0L, 0L, 1L, 1L, 1L, 0L, 0L, 1L, 1L, 0L, 1L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 0L), 36L, 
          0L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(27L, 42L, 59L, 80L), 2L, 
          15L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(-96L, -94L, 10L, -36L, 18L, -40L), 4L, 
          2L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 12L, 
          0L
      )))
  
  }
  
  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;
  }