Creating a set to store the last positions of occurrence
import java . util . * ; class GFG { static int longestUniqueSubsttr ( String s ) { HashMap < Character , Integer > seen = new HashMap < > ( ) ; int maximum_length = 0 ;