Given a string S, find the length of the longest substring without repeating characters.
S = "geeksforgeeks"
Longest substring is
S = "abdefgabef"
Longest substring are
"abdefg" , "bdefga" and "defgab".
You don't need to take input or print anything. Your task is to complete the function longestUniqueSubsttr() which takes a string S as and returns the length of the longest substring.
Expected Time Complexity: O(|S|).
Expected Auxiliary Space: O(K) where K is constant.
We strongly recommend solving this problem on your own before viewing its editorial. Do you still
want to view the editorial?
Login to access your submissions.