Creating a set to store the last positions of occurrence
#include <bits/stdc++.h> NEW_LINE using namespace std ; int longestUniqueSubsttr ( string s ) { map < char , int > seen ; int maximum_length = 0 ;