Description: Input a string, output the max substring that not contains repeated chars.
Solution: Sliding window.
- Define two points left-point&&right-point than point to the beginning of the string.
- Using right-point to foreach string, add each char to the set.
- Before add the char to the set, checking whether it already exist in the set.
- If the char in the set, recompute the max-size-substring and removing all chars in the set that is font the char and left-point point to the char + 1.
- After the end of foreach, recompute the max-size-substring again avoiding all chars are different.