You need to sign in to do that
Don't have an account?

remove deuplicate and original value from list
I have a list and I need to find if a duplicate value exists in the list and remove both the duplicate value and the original value.
I know I can remove the duplicate by using a map or set, but I need to remove the original value as well.
For example, if I have a string list:
List<String> strings = new List<String>{ 'one', 'two', 'three', 'four', 'one', 'four'};
after removing the duplicates and originals I would have:
{ 'two', 'three' }
Any help is appeciated.
Thanks.
Hi boheminanguy100,
with a list, I think that you will have to loop twice through it. This is how I would do it.
Let me know if this helps...