Pregunta de entrevista de Pocket Gems

Implement indexOf function given a haystack and needle string