Algorithm to find a number and its square in an array -
I have an array of integers, and I need an O algorithm to know that array Has a number and its square; A pair is enough.
I tried to do it myself, but I only managed to find a solution in O (n 2 ).
I thought of using counting sort, but memory usage is too big.