List Unique Items
Create a method uniqueItems
.
uniqueItems
accepts a list of Any
s and returns a count of how many of the objects in the list are unique,
meaning that there are no other objects in the list that are equal to them.
For example, given the list {1, 2, 4}
you would return 3, whereas given the list {2, 2, 5}
you would return 1.
The list may contain any kind of Any
.
You may use collections like Map
s or Set
s for this problem, but they are not required.