title: Pair With Given Product Set 1 Find If Any Pair Exists
signature: function pairWithGivenProductSet1FindIfAnyPairExists(arr: Array<number>, n: number, x: number): boolean {
source_py: def pair_with_given_product_set_1_find_if_any_pair_exists(arr, n, x):
      for i in arr:
          for j in arr:
              if ((i * j) == x):
                  return True
      return False
source_cpp: bool pair_with_given_product_set_1_find_if_any_pair_exists(vector<int> arr, int n, int x) {
    for ( int i = 0;
    i < n - 1;
    i ++ ) for ( int j = i + 1;
    i < n;
    i ++ ) if ( arr [ i ] * arr [ j ] == x ) return true;
    return false;
  }
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"arr": [10, 20, 9, 40], "n": 4, "x": 400}}, {"idx": 1, "outputs": true, "inputs": {"arr": [1, -10, 20, 9, -40], "n": 5, "x": 400}}, {"idx": 2, "outputs": false, "inputs": {"arr": [0, 0, 0, 0, 0, 1, 1, 1, 1], "n": 7, "x": 8}}, {"idx": 3, "outputs": true, "inputs": {"arr": [4, 10, 20, 9, -40], "n": 5, "x": -400}}, {"idx": 4, "outputs": false, "inputs": {"arr": [-90, -86, -76, -72, -70, -62, -56, -50, -18, -12, -10, 4, 16, 26, 42, 48, 52, 54, 54, 70, 84, 86, 88, 98], "n": 23, "x": 23}}, {"idx": 5, "outputs": false, "inputs": {"arr": [1], "n": 0, "x": 0}}, {"idx": 6, "outputs": false, "inputs": {"arr": [4, 7, 14, 14, 16, 18, 19, 20, 22, 24, 29, 38, 38, 38, 40, 40, 46, 46, 47, 51, 51, 52, 55, 56, 56, 62, 62, 62, 78, 79, 81, 84, 86, 88, 89, 89, 89], "n": 23, "x": 32}}, {"idx": 7, "outputs": false, "inputs": {"arr": [72, 80, -82, 24, -98, 90, -32, -56, -22, 8, -12, 8, -78, 60, -62, 50, 12, -60, 10, -54, 74, 98, 26, 56, 24], "n": 21, "x": 19}}, {"idx": 8, "outputs": false, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "n": 22, "x": 18}}, {"idx": 9, "outputs": false, "inputs": {"arr": [93, 40, 48, 99, 95, 59, 43, 58, 79, 70, 28], "n": 9, "x": 5}}]
question_info.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: boolean, expected: boolean): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(arr: Array<number>, n: number, x: number, expected:boolean): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, x),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver([10, 20, 9, 40], 4, 400, true);
    console.log(`TEST-0...${result}`);
  
    result = driver([1, -10, 20, 9, -40], 5, 400, true);
    console.log(`TEST-1...${result}`);
  
    result = driver([0, 0, 0, 0, 0, 1, 1, 1, 1], 7, 8, false);
    console.log(`TEST-2...${result}`);
  
    result = driver([4, 10, 20, 9, -40], 5, -400, true);
    console.log(`TEST-3...${result}`);
  
    result = driver([-90, -86, -76, -72, -70, -62, -56, -50, -18, -12, -10, 4, 16, 26, 42, 48, 52, 54, 54, 70, 84, 86, 88, 98], 23, 23, false);
    console.log(`TEST-4...${result}`);
  
    result = driver([1], 0, 0, false);
    console.log(`TEST-5...${result}`);
  
    result = driver([4, 7, 14, 14, 16, 18, 19, 20, 22, 24, 29, 38, 38, 38, 40, 40, 46, 46, 47, 51, 51, 52, 55, 56, 56, 62, 62, 62, 78, 79, 81, 84, 86, 88, 89, 89, 89], 23, 32, false);
    console.log(`TEST-6...${result}`);
  
    result = driver([72, 80, -82, 24, -98, 90, -32, -56, -22, 8, -12, 8, -78, 60, -62, 50, 12, -60, 10, -54, 74, 98, 26, 56, 24], 21, 19, false);
    console.log(`TEST-7...${result}`);
  
    result = driver([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 22, 18, false);
    console.log(`TEST-8...${result}`);
  
    result = driver([93, 40, 48, 99, 95, 59, 43, 58, 79, 70, 28], 9, 5, false);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: pairWithGivenProductSet1FindIfAnyPairExists
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js