Intuition
- Use two pointers begin and end to represent the range of the substring.
- Use a set to save the characters that has appeared.
- when the end meet a character which has appeared, the start to move the begin, until the begin is the character.
solution
|
|
problem
WA
reason
Forget to delete the character in the set when moving the begin.
modification
|
|