How to solve this question?

Revision en1, by samuels_882, 2019-12-06 16:40:11

Given an array A of size n.count the number of pairs such that A[i]*A[j]==A[i]+A[j]. Since the constraint of A[i] is upto 10^9 and N is upto 40,000 , I cannot run the naive technique of running a double loop. Any other way to solve it in one loop?

Tags #implementation

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English samuels_882 2019-12-06 16:40:11 274 Initial revision (published)