Pergunta de entrevista da empresa Amazon

Find substring within words, efficiently.