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
https://leetcode.com/problems/rotate-string/description/
Last updated 1 year ago