Pregunta de entrevista de Tata Consultancy Services

what is best algorithm to search a string with pattern