X Interview Question

implement strstr function and optimize.