for i = 1 to N
{
if(arr[arr[i]] is negative)
return arr[i];
else
arr[arr[i]] *= (-1);
}
return No_duplicates;
N is the size of array and n <= N.
Read full article from First Repeated Number. | techpuzzl
Read full article from First Repeated Number. | techpuzzl
No comments:
Post a Comment