update longest non repeated substring