title: Pair With Given Product Set 1 Find If Any Pair Exists
signature: class Solution {
  
      public Boolean pairWithGivenProductSet1FindIfAnyPairExists(ArrayList<Integer> arr, Integer n, Integer x) {
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.extension: java
question_info.entry_fn_name: pairWithGivenProductSet1FindIfAnyPairExists
question_info.entry_cls_name: Solution
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.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(ArrayList<Integer> arr, Integer n, Integer x, Boolean expected){
          try{
              Driver driver = new Driver();
              if (driver.run(arr, n, x,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(new ArrayList<>(Arrays.asList(10, 20, 9, 40)), 4, 400, true);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(1, -10, 20, 9, -40)), 5, 400, true);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(0, 0, 0, 0, 0, 1, 1, 1, 1)), 7, 8, false);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(4, 10, 20, 9, -40)), 5, -400, true);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-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);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(1)), 0, 0, false);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(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);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(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);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(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);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(93, 40, 48, 99, 95, 59, 43, 58, 79, 70, 28)), 9, 5, false);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(ArrayList<Integer> arr, Integer n, Integer x, Boolean expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, n, x),expected);
      }
      
      public boolean validateSolution(Boolean actual, Boolean expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__