# Condition using multiple variable over a list [closed]

I have been trying to remove duplicates elements from a list using delete cases instead of the conventional deleteDuplicates function. I wrote something like

DeleteCases[list,x_ y_/;(x-y)==0] which obviously did not work. How do I iterate over different elements in the list without using for loops or while ?

• Are you sure you don't want DeleteDuplicates? You can supply a second argument, i.e., DeleteDuplicates[list,#-#2==0.&] – b3m2a1 Mar 14 '17 at 6:21
• Why not use Union? – Anjan Kumar Mar 14 '17 at 6:21
• @AnjanKumar Union will apply a sorting to the list. That's unnecessary if he just wants to remove the duplicates. There DeleteDuplicates is sufficient. – b3m2a1 Mar 14 '17 at 6:23
• @AbheshekPal asked about removing the same elements without using cycles. And he wrote about deleteDublicates. I thought it is not appropriate for the your task – Kirill Belov Mar 14 '17 at 7:51