def find_all_indexes(text, pattern):
    """Return a list of starting indexes of all occurrences of pattern in text,
    or an empty list if not found.
    o(n) runtime, based off the length of the text."""
    assert isinstance(text, str), 'text is not a string: {}'.format(text)
    assert isinstance(pattern, str), 'pattern is not a string: {}'.format(text)
    # Implement find_all_indexes here (iteratively and/or recursively)
    text_i = 0
    pattern_i = 0
    indexes = []
    if pattern == "":
        return [x for x in range(len(text))]
    elif len(pattern) == 1:
        return [i for i, x in enumerate(text) if pattern == x]
    elif len(pattern) > len(text):
        return []
    elif text == pattern:
        return [0]
        
    while text_i < len(text) and pattern_i < len(pattern):
        if pattern[pattern_i] == text[text_i]:
            if pattern_i == len(pattern) - 1:
                indexes.append(text_i - pattern_i)
                text_i -= pattern_i - 1
                pattern_i = 0
            text_i += 1
            pattern_i += 1
        elif pattern[pattern_i] != text[text_i]:
            if pattern_i != 0:
                text_i -= pattern_i - 1
                pattern_i = 0
            else:
                text_i += 1
    return indexes