def find_index(text, pattern, index=0, iterator=0):
    """Return the starting index of the first occurrence of pattern in text,
    or None if not found.
    Runtime, worst case: O(n), n is len(text)
    Runtime, best case: O(1), if text == ''
    Space Complexity: O(1), creating no new variables
    """
    assert isinstance(text, str), 'text is not a string: {}'.format(text)
    assert isinstance(pattern, str), 'pattern is not a string: {}'.format(text)
    
    if text == '':
        return None
    elif pattern == '':
        return 0

    if index < len(text):  #if text[index] exists
        if text[index] == pattern[iterator]:
            if iterator == len(pattern) - 1:
                return index - iterator
            
            return find_index(text, pattern, index+1, iterator+1)
        elif iterator > 0:
            return find_index(text, pattern, index)
        else:
            return find_index(text, pattern, index+1)
    else:
        return None