4 line if allowed to use stl function 'find'


#1

int Solution::strStr(const string A, const string B) {
if(A.empty()||B.empty()) return 0;
if(A.find(B)==string::npos)
return -1;
else return A.find(B);
}