Java Program to find the duplication in a string

Example 1:



Output :

Duplicate words in a given string :
big
black