def non_repeat_substring1(s):
    """Find the length of the longest substring with no repeating characters.

    Time:  O(n)
    Space: O(1) // size of the alphabet for the set

    >>> non_repeat_substring1("")
    0
    >>> non_repeat_substring1("a")
    1
    >>> non_repeat_substring1("aabccbb")
    3
    >>> non_repeat_substring1("abbbb")
    2
    >>> non_repeat_substring1("abccde")
    3

    """
    win_start = 0
    char_index = {}
    max_len = 0
    for win_end in range(len(s)):
        last_char = s[win_end]
        if last_char in char_index:
            win_start = max(win_start, char_index[last_char] + 1)
        char_index[last_char] = win_end
        max_len = max(max_len, win_end - win_start + 1)
    return max_len