title: Find Minimum Difference Pair 1
signature: def findMinimumDifferencePair1(arr: List[Int], n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(arr: List[Int], n: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        List(3, 25, 44, 46, 54, 60, 81), 3, 
        19    
      )}")   
  
  
      println(s"TEST-1...${driver(
        List(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    
      )}")   
  
  
      println(s"TEST-2...${driver(
        List(1, 1, 1), 2, 
        0    
      )}")   
  
  
      println(s"TEST-3...${driver(
        List(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    
      )}")   
  
  
      println(s"TEST-4...${driver(
        List(-74, -48, -42, -26, -16, -12, 0, 4, 8, 18, 46, 46, 62, 70, 74, 88, 92, 96, 98), 18, 
        0    
      )}")   
  
  
      println(s"TEST-5...${driver(
        List(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    
      )}")   
  
  
      println(s"TEST-6...${driver(
        List(27, 42, 59, 80), 2, 
        15    
      )}")   
  
  
      println(s"TEST-7...${driver(
        List(-96, -94, 10, -36, 18, -40), 4, 
        2    
      )}")   
  
  
      println(s"TEST-8...${driver(
        List(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1), 12, 
        0    
      )}")   
  
  }
  
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;
  }