LeetCode 28 Implement strStr()
#include <string>
using namespace std;
class Solution {
public:
int strStr(string haystack, string needle) {
int position;
if (haystack.find(needle) != string::npos)
position = haystack.find(needle);
else
position = -1;
return position;
}
};