Last updated 1 year ago
string temp = s + s; return (temp.find(goal) != string::npos); Here the time complexity of npos find is n * m Where n and m are lenght of strings