Try to using HashSet to remove the duplicated elements