add better solution for longest non-repeatable-character substr

Signed-off-by: Mory Mobile <mory.mobile@gmail.com>