def max_substring_without_repetition(s: str) -> int:
last_found_at = {}
left = 0
ans = 0
for right in range(len(s)):
current_char = s[right]
if current_char in last_found_at:
left = max(left, last_found_at[current_char]+1)
last_found_at[current_char] = right
ans = max(ans, right - left +1)
return ans