Update Longest Substring