title: Count Pairs Whose Products Exist In Array 1
signature: func countPairsWhoseProductsExistInArray1(arr []int, n int) int {
source_py: def count_pairs_whose_products_exist_in_array_1(arr, n):
      result = 0
      Hash = set()
      for i in range(n):
          Hash.add(arr[i])
      for i in range(n):
          for j in range((i + 1), n):
              product = (arr[i] * arr[j])
              if (product in Hash):
                  result += 1
      return result
source_cpp: int count_pairs_whose_products_exist_in_array_1(vector<int> arr, int n) {
    int result = 0;
    set < int > Hash;
    for ( int i = 0;
    i < n;
    i ++ ) Hash . insert ( arr [ i ] );
    for ( int i = 0;
    i < n;
    i ++ ) {
      for ( int j = i + 1;
      j < n;
      j ++ ) {
        int product = arr [ i ] * arr [ j ];
        if ( Hash . find ( product ) != Hash . end ( ) ) result ++;
      }
    }
    return result;
  }