Pergunta de entrevista da empresa Pocket Gems

Implement indexOf function given a haystack and needle string