Longest Substring Without Repeating Characters: refactor, now the time complexity is O(n)