def find_longest_substr(source_str):
char_position[source_str[0]] = 0
while (right < len(source_str)):
cur_char = source_str[right]
last_pos = char_position.get(cur_char, None)
if last_pos is not None and last_pos >= left:
cur_length = right - last_pos
if cur_length > substr_lenght:
substr_lenght = cur_length
char_position[cur_char] = right
return source_str[substr_start: substr_start + substr_lenght + 1]
if __name__ == "__main__":
print(find_longest_substr('abcdabcdefabcabdefg12345p67890acccghdkjzabc'))