How to check if there are duplicates in a list of strings?

Just a quick question…

How do i print out the value that is a duplicate using exact your method?

Here is a small example:
2