Identify duplicates in a List
152
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?
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?