modify [leet] longest substring without repeating chars, with more logical way