Algorithm: The simplest way to solve this problem is to use a Simple Nested Loop.
The key idea here is to iterate through each character in the string and for each character, check if it has already appeared earlier in the string.
If a character is found to be repeating, returned the currently picked character immediately as the result.
If no character repeats, the returns "-1".
Download
0 formats
No download links available.
Java Program to Finding First Repeating Character in String by SLT Learning (Most Commonly Asked) | NatokHD