Thought Machine Interview Question

To write up a search in string algorithm on the whiteboard in python-esque script