Update LongestSubstring