Computer Programming

How to find all 2 pairs of integers that have the same product in an array in O(n)?

Given an array arr[] of N integers, the task is to find all 2 pairs (a, b) such as:  (a1* b1), (a2*b2)…. = p1 (a3*b3), (a4*b4)…. = p2 (a5*b5),

Read More