Paintzen interview question

Algorithm problem involving string matching