Pergunta de entrevista da empresa Meta

Write algorithm to find patterns in strings.