385,156 views
24 votes
24 votes
How to find duplicate characters in a string in java.

User Limey
by
2.5k points

1 Answer

8 votes
8 votes

Answer:

Find duplicate characters in string

1. Split the string into character array.

2. Iterate over character array.

3. For each iteration, use character as map key and check is same character is present in map, already.

4. If map key does not exist it means the character has been encountered first time.

Step-by-step explanation:

I'm just intelligent in that area of java

User Rebca
by
3.0k points