title: Minimum Xor Value Pair
signature: fun minimumXorValuePair(arr: ArrayList<Int>, n: Int): Int {
source_py: def minimum_xor_value_pair(arr, n):
      arr.sort()
      min_xor = 999999
      val = 0
      for i in range(0, (n - 1)):
          for j in range((i + 1), (n - 1)):
              val = (arr[i] ^ arr[j])
              min_xor = min(min_xor, val)
      return min_xor
source_cpp: int minimum_xor_value_pair(vector<int> arr, int n) {
    int min_xor = INT_MAX;
    for ( int i = 0;
    i < n;
    i ++ ) for ( int j = i + 1;
    j < n;
    j ++ ) min_xor = min ( min_xor, arr [ i ] ^ arr [ j ] );
    return min_xor;
  }
question_info.test_list: [{"idx": 0, "outputs": 0, "inputs": {"arr": [4, 5, 7, 10, 10, 11, 14, 19, 21, 24, 27, 27, 27, 28, 28, 28, 33, 34, 41, 42, 43, 48, 52, 53, 53, 59, 62, 64, 66, 71, 77, 78, 78, 79, 80, 82, 90, 97, 99, 99], "n": 34}}, {"idx": 1, "outputs": -96, "inputs": {"arr": [-96, -94, -94, -84, -70, -68, -66, -64, -58, -28, -22, -16, -14, -10, -2, 0, 8, 28, 36, 42, 50, 52, 56, 56, 56, 66, 74, 80, 80, 88, 90, 90, 90, 94], "n": 17}}, {"idx": 2, "outputs": 0, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], "n": 9}}, {"idx": 3, "outputs": 0, "inputs": {"arr": [10, 11, 17, 23, 25, 31, 39, 42, 45, 48, 57, 60, 63, 65, 73, 73, 75, 83, 94, 96, 97, 97], "n": 21}}, {"idx": 4, "outputs": 0, "inputs": {"arr": [-92, -92, -90, -88, -84, -82, -66, -64, -64, -62, -44, -42, -40, -28, -22, -12, -4, -2, 0, 4, 16, 22, 28, 34, 54, 60, 72, 74, 78, 86, 94], "n": 18}}, {"idx": 5, "outputs": 0, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "n": 36}}, {"idx": 6, "outputs": 0, "inputs": {"arr": [2, 2, 6, 13, 16, 16, 17, 19, 19, 20, 22, 25, 27, 29, 34, 34, 34, 36, 38, 39, 42, 49, 49, 53, 59, 59, 71, 77, 79, 82, 83, 83, 84, 84, 86, 86, 87, 88, 93, 96], "n": 36}}, {"idx": 7, "outputs": -96, "inputs": {"arr": [-96, -94, -92, -82, -54, -50, -48, -46, -46, -28, -28, -28, -20, -14, -14, 6, 12, 14, 20, 22, 24, 36, 36, 44, 46, 70, 74, 82, 92, 96, 96], "n": 20}}, {"idx": 8, "outputs": 0, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "n": 39}}, {"idx": 9, "outputs": 0, "inputs": {"arr": [4, 5, 11, 12, 12, 13, 17, 18, 19, 22, 23, 23, 23, 27, 32, 33, 34, 38, 42, 48, 48, 50, 51, 54, 60, 62, 64, 69, 70, 70, 75, 76, 77, 78, 79, 82, 93, 94, 96, 99], "n": 30}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(arr: ArrayList<Int>, n: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(arr, n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(arrayListOf(4, 5, 7, 10, 10, 11, 14, 19, 21, 24, 27, 27, 27, 28, 28, 28, 33, 34, 41, 42, 43, 48, 52, 53, 53, 59, 62, 64, 66, 71, 77, 78, 78, 79, 80, 82, 90, 97, 99, 99), 34, 0)
      println("TEST-0...${result}")
      
      result = driver(arrayListOf(-96, -94, -94, -84, -70, -68, -66, -64, -58, -28, -22, -16, -14, -10, -2, 0, 8, 28, 36, 42, 50, 52, 56, 56, 56, 66, 74, 80, 80, 88, 90, 90, 90, 94), 17, -96)
      println("TEST-1...${result}")
      
      result = driver(arrayListOf(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1), 9, 0)
      println("TEST-2...${result}")
      
      result = driver(arrayListOf(10, 11, 17, 23, 25, 31, 39, 42, 45, 48, 57, 60, 63, 65, 73, 73, 75, 83, 94, 96, 97, 97), 21, 0)
      println("TEST-3...${result}")
      
      result = driver(arrayListOf(-92, -92, -90, -88, -84, -82, -66, -64, -64, -62, -44, -42, -40, -28, -22, -12, -4, -2, 0, 4, 16, 22, 28, 34, 54, 60, 72, 74, 78, 86, 94), 18, 0)
      println("TEST-4...${result}")
      
      result = driver(arrayListOf(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), 36, 0)
      println("TEST-5...${result}")
      
      result = driver(arrayListOf(2, 2, 6, 13, 16, 16, 17, 19, 19, 20, 22, 25, 27, 29, 34, 34, 34, 36, 38, 39, 42, 49, 49, 53, 59, 59, 71, 77, 79, 82, 83, 83, 84, 84, 86, 86, 87, 88, 93, 96), 36, 0)
      println("TEST-6...${result}")
      
      result = driver(arrayListOf(-96, -94, -92, -82, -54, -50, -48, -46, -46, -28, -28, -28, -20, -14, -14, 6, 12, 14, 20, 22, 24, 36, 36, 44, 46, 70, 74, 82, 92, 96, 96), 20, -96)
      println("TEST-7...${result}")
      
      result = driver(arrayListOf(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), 39, 0)
      println("TEST-8...${result}")
      
      result = driver(arrayListOf(4, 5, 11, 12, 12, 13, 17, 18, 19, 22, 23, 23, 23, 27, 32, 33, 34, 38, 42, 48, 48, 50, 51, 54, 60, 62, 64, 69, 70, 70, 75, 76, 77, 78, 79, 82, 93, 94, 96, 99), 30, 0)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: minimumXorValuePair
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn