One line answer using find() in C++ (if allowed to use)!


#1

int Solution::strStr(const string A, const string B)
{
return A.find(B);
}