This, again, is considered a sliding window problem

Did not solve this problem on my own. The logic of this question goes like this: In order to find substring without repeating characters, we just put them into a HashSet and we have 2 pointers point to the beginning.
If the HashSet does not contain the character the right pointer is pointing to, then add it to the HashSet. And then we make right++. Also, we update the max. We compare currently how big the size of the HashSet is with the old max.
If the HashSet does contain the character already, we know that we have encountered a repeated character.
(for example, left is pointing to a and right is pointing to the second a)
a b c a b c b b
At this moment, a is already in the HashSet. What we do is that we simply remove a from the HashSet, and then make left++. Therefore, currently our HashSet has b and c. We do not need to clean up the whole HashSet. We can just make right pointer keep going to see how far(long) we can go this time.
A few syntax things to notice:
HashSet is like a HashMap but only with the keys.
to get a character of a string we use string.charAt(index)