Pregunta de entrevista de Meta

Write algorithm to find patterns in strings.