fix the bug in solution of length of longest substring