update lengthOfLongestSubstring