Qualcomm Interview Question

Finding a sub string in a string. I gave a correct answer with poor time complexity. He asked me to implement it with lesser time complexity.