Identify duplicates in a List

asked14 years ago
last updated14 years ago
viewed301.9k times
Up Vote152Down Vote

I have a List of type Integer eg:

[1, 1, 2, 3, 3, 3]

I would like a method to return all the duplicates eg:

[1, 3]

What is the best way to do this?