How can I select the duplicate values in a list?
Example:
{1, 2, 1, 1, 1, 1}
How can I select the duplicate values in a list?
Example:
{1, 2, 1, 1, 1, 1}
If you want all duplicates then:
list = {1, 2, 1, 1, 1, 1}
Select[Split@Sort@list, Length@# > 1 &]
if you want one from each duplicate then
Select[Split@Sort@list, Length@# > 1 &][[;;,1]]
{1}. Please make an effort. – Öskå Jun 09 '14 at 15:17