暴力双指针
class Solution {
public:
int strStr(string haystack, string needle) {
int i, j, k;
i = j = k = 0;
while(i < haystack.size() && j < needle.size()){
if(haystack[k] == needle[j]) k ++, j ++ ;
else{
j = 0;
i ++ ;
k = i;
if(haystack.size() - k + 1 < needle.size()) return -1;
}
}
if(j == needle.size()) return i;
return -1;
}
};