title: Pair With Given Product Set 1 Find If Any Pair Exists 1
signature: fun pairWithGivenProductSet1FindIfAnyPairExists1(arr: ArrayList<Int>, n: Int, x: Int): Boolean {
source_py: def pair_with_given_product_set_1_find_if_any_pair_exists_1(arr, n, x):
      if (n < 2):
          return False
      s = set()
      for i in range(0, n):
          if (arr[i] == 0):
              if (x == 0):
                  return True
              else:
                  continue
          if ((x % arr[i]) == 0):
              if ((x // arr[i]) in s):
                  return True
              s.add(arr[i])
      return False
source_cpp: bool pair_with_given_product_set_1_find_if_any_pair_exists_1(vector<int> arr, int n, int x) {
    if ( n < 2 ) return false;
    unordered_set < int > s;
    for ( int i = 0;
    i < n;
    i ++ ) {
      if ( arr [ i ] == 0 ) {
        if ( x == 0 ) return true;
        else continue;
      }
      if ( x % arr [ i ] == 0 ) {
        if ( s . find ( x / arr [ i ] ) != s . end ( ) ) return true;
        s . insert ( arr [ i ] );
      }
    }
    return false;
  }
question_info.test_list: [{"idx": 0, "outputs": false, "inputs": {"arr": [1, 2, 3, 7, 23, 23, 25, 27, 37, 42, 53, 56, 58, 61, 69, 78, 79, 84, 85, 86, 90, 93, 95], "n": 15, "x": 17}}, {"idx": 1, "outputs": false, "inputs": {"arr": [-10, -18, 88, -36, 78, 66, -70, -34, -88, -98, -70, -4, -94, -92, -76, -78, -30, -48, -72, 86, -64, 38, -80, 20, 70, -32, -90, 74, -78, 12, -54, 88, 38, -96, 28], "n": 17, "x": 22}}, {"idx": 2, "outputs": false, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 0, 0, 1, 1], "n": 9, "x": 5}}, {"idx": 3, "outputs": false, "inputs": {"arr": [83, 61, 55, 89, 16, 78, 44, 54, 22, 49, 58, 62, 53, 99, 35, 83, 29, 19, 96, 39, 60, 6, 34, 67, 43, 29, 46, 3, 81, 78, 80, 39, 86, 78, 21], "n": 23, "x": 27}}, {"idx": 4, "outputs": true, "inputs": {"arr": [-96, -88, -80, -62, -58, -56, -54, -52, -34, -20, -6, -2, 6, 20, 52, 54, 70, 72, 80, 82, 94], "n": 18, "x": 12}}, {"idx": 5, "outputs": false, "inputs": {"arr": [0, 1, 1, 0, 0, 1, 1, 1], "n": 4, "x": 6}}, {"idx": 6, "outputs": false, "inputs": {"arr": [8, 11, 11, 20, 22, 23, 26, 27, 31, 38, 40, 40, 45, 46, 46, 48, 50, 61, 73, 76, 78, 78, 79, 80, 81, 84, 90, 91, 93, 95], "n": 24, "x": 28}}, {"idx": 7, "outputs": false, "inputs": {"arr": [18], "n": 0, "x": 0}}, {"idx": 8, "outputs": false, "inputs": {"arr": [0, 0, 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], "n": 37, "x": 39}}, {"idx": 9, "outputs": false, "inputs": {"arr": [19, 37, 47, 40, 72, 59, 51, 53, 92, 3, 21, 81, 29, 48, 97, 59, 10, 74, 11, 37, 49, 95, 88, 85, 6, 26, 76, 33], "n": 22, "x": 21}}]
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:Boolean, expected:Boolean):Boolean{
    return actual.equals(expected)
  }
  fun driver(arr: ArrayList<Int>, n: Int, x: Int, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, x), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(arrayListOf(1, 2, 3, 7, 23, 23, 25, 27, 37, 42, 53, 56, 58, 61, 69, 78, 79, 84, 85, 86, 90, 93, 95), 15, 17, false)
      println("TEST-0...${result}")
      
      result = driver(arrayListOf(-10, -18, 88, -36, 78, 66, -70, -34, -88, -98, -70, -4, -94, -92, -76, -78, -30, -48, -72, 86, -64, 38, -80, 20, 70, -32, -90, 74, -78, 12, -54, 88, 38, -96, 28), 17, 22, false)
      println("TEST-1...${result}")
      
      result = driver(arrayListOf(0, 0, 0, 0, 0, 0, 0, 0, 1, 1), 9, 5, false)
      println("TEST-2...${result}")
      
      result = driver(arrayListOf(83, 61, 55, 89, 16, 78, 44, 54, 22, 49, 58, 62, 53, 99, 35, 83, 29, 19, 96, 39, 60, 6, 34, 67, 43, 29, 46, 3, 81, 78, 80, 39, 86, 78, 21), 23, 27, false)
      println("TEST-3...${result}")
      
      result = driver(arrayListOf(-96, -88, -80, -62, -58, -56, -54, -52, -34, -20, -6, -2, 6, 20, 52, 54, 70, 72, 80, 82, 94), 18, 12, true)
      println("TEST-4...${result}")
      
      result = driver(arrayListOf(0, 1, 1, 0, 0, 1, 1, 1), 4, 6, false)
      println("TEST-5...${result}")
      
      result = driver(arrayListOf(8, 11, 11, 20, 22, 23, 26, 27, 31, 38, 40, 40, 45, 46, 46, 48, 50, 61, 73, 76, 78, 78, 79, 80, 81, 84, 90, 91, 93, 95), 24, 28, false)
      println("TEST-6...${result}")
      
      result = driver(arrayListOf(18), 0, 0, false)
      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, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), 37, 39, false)
      println("TEST-8...${result}")
      
      result = driver(arrayListOf(19, 37, 47, 40, 72, 59, 51, 53, 92, 3, 21, 81, 29, 48, 97, 59, 10, 74, 11, 37, 49, 95, 88, 85, 6, 26, 76, 33), 22, 21, false)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: pairWithGivenProductSet1FindIfAnyPairExists1
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