Pergunta de entrevista da empresa Didi Chuxing

How to search sub-string in a string, and how to improve the performance.

Resposta da entrevista

Sigiloso

13 de nov. de 2017

I gave a brutal force solution at the beginning. Then, with the hint of the interviewer, I added some pre-processing. But still, my answer is not good enough.