def contains(text: str, pattern: str, start=0) -> bool:
    """Return a boolean indicating whether pattern occurs in text."""
    assert isinstance(text, str), 'text is not a string: {}'.format(text)
    assert isinstance(pattern, str), 'pattern is not a string: {}'.format(text)
    # Iterative

    # ! Runtime = O(n), n is len of text. Text must be iterated over. 

    # case: pattern length is greater than text
    if len(pattern) > len(text):
        return False
    # case: pattern is empty
    if pattern == '' or "":
        return True

    # no need to check the rest of text if pattern length exceeds remainder
    for index in range(start, len(text) - len(pattern) + 1):
        # case: check if first letter of pattern exists in text
        if text[index] == pattern[0]:
            # A slice of text that is the length of pattern starting from text[i] to check if the remaining pattern follows after text[i]
            rest = text[index: index + len(pattern)]
            if rest == pattern:
                return True
    # case: pattern not in text
    return False