# 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 ?

## closed as off-topic by MarcoB, happy fish, gwr, bbgodfrey, ubpdqnMar 19 '17 at 10:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – bbgodfrey, ubpdqn
If this question can be reworded to fit the rules in the help center, please edit the question.

• 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