how to remove repeated elements from array in c