Create a program to discover which words in a list occurs only once and which occurs more than once, but you do not want any duplicates printed out repeatedly. This effect can be achieved by generating two sets: one containing every word in the argument list and the other containing only the duplicates. The words that occur only once are the set difference of these two sets.


Updated: Nov. 27, 2020 — Training Time: 2 minutes
Overseen by: Archangel Macsika
Topic: Array - Java Programming

Difficulty: Easy.

Companies who previously asked this: -.

Objective: Create a program to discover which words in a list occurs only once and which occurs more than once, but you do not want any duplicates printed out repeatedly. This effect can be achieved by generating two sets: one containing every word in the argument list and the other containing only the duplicates. The words that occur only once are the set difference of these two sets.

Input: Random list of duplicate and distinct words.

Expected Output: Result will vary based on the user input.

Sikademy Solution

Was this training resource helpful?