https://leetcode.com/problems/implement-strstr/
class Solution {
public:
int strStr(string haystack, string needle) {
int len1=haystack.size(), len2=needle.size();
if(len2==0||haystack==needle) return 0;
for(int i=0; i<len1-len2+1; i++){
for(int j=0; j<len2;j++){
if(haystack[i+j]!=needle[j]) break;
if(j==len2-1) return i;
}
}
return -1;
}
};