Java program to find the duplicate characters in a string
In this program, we need to find the duplicate characters in the string.
To find the duplicate character from the string, we count the occurrence of each character in the string. If count is greater than 1, it implies that a character has a duplicate entry in the string. In above example, the characters highlighted in green are duplicate characters.
Duplicate characters in a given string: r e t s i