title: Count Pairs Whose Products Exist In Array
signature: count_pairs_whose_products_exist_in_array <- function(arr, n) {
source_py: def count_pairs_whose_products_exist_in_array(arr, n):
      result = 0
      for i in range(0, n):
          for j in range((i + 1), n):
              product = (arr[i] * arr[j])
              for k in range(0, n):
                  if (arr[k] == product):
                      result = (result + 1)
                      break
      return result
source_cpp: int count_pairs_whose_products_exist_in_array(vector<int> arr, int n) {
    int result = 0;
    for ( int i = 0;
    i < n;
    i ++ ) {
      for ( int j = i + 1;
      j < n;
      j ++ ) {
        int product = arr [ i ] * arr [ j ];
        for ( int k = 0;
        k < n;
        k ++ ) {
          if ( arr [ k ] == product ) {
            result ++;
            break;
          }
        }
      }
    }
    return result;
  }