Program to remove duplicates from an aray