Task 2 of 7 · 0 solved · 7 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

10.2 HashSet — count distinct values

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Fill in countUnique so that it returns the number of distinct words. Add them all to a set and read its size — the duplicates collapse by themselves.

The program prints 3 and then 0.

Your solution