//this code is to remove all dupicates of a given array.