Given a string input of length n, find the length of the longest substring without repeating characters i.e return a substring that does not have any repeating characters.
Substring is the continuous sub-part of the string formed by removing zero or more characters from both ends.
1<= n <=10^5
Time Limit: 1 sec
abcabcbb
Sample Output1:
3
Explanation For Sample Input 1:
Substring "abc" has no repeating character with the length of 3.
Sample Input 2:
aaaa
Sample Output 2:
1