题目连接:Leetcode 028 Implement strStr()
解题思路:KMP裸题,并且string类里面封装好了一个方法 find。
class Solution {
public:
int strStr(string haystack, string needle) {
int t = haystack.find(needle);
return t;
}
};
题目连接:Leetcode 028 Implement strStr()
解题思路:KMP裸题,并且string类里面封装好了一个方法 find。
class Solution {
public:
int strStr(string haystack, string needle) {
int t = haystack.find(needle);
return t;
}
};