It's marginally more efficient: While the difference is negligible, the double-unary operator can be more efficient in ...
A simple way to do it would be to have a hashmap and iterate through the list once. For every item, add it to the hash with the object as the key and a counter as the value for that key. So if the ...