Count pairs in array whose product is divisible by k

Any solution to this question other than n square approach

Comments (2)