If you trust this link, click it to continue.
http://javarevisited.blogspot.com/2021/10/how-to-find-first-recurring-character.html