Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s.

A shift on s consists of moving the leftmost character of s to the rightmost position.


	For example, if s = "abcde", then it will be "bcdea" after one shift.


&nbsp;
Example 1:
Input: s = "abcde", goal = "cdeab"
Output: true
Example 2:
Input: s = "abcde", goal = "abced"
Output: false

&nbsp;
Constraints:


	1 &lt;= s.length, goal.length &lt;= 100
	s and goal consist of lowercase English letters.


class Solution:
    def rotateString(self, s: str, goal: str) -> bool:
        for x in range(len(s)):
            s = s[-1] + s[:-1]
            if (goal == s):
                return True
        return False
class Solution {
    public boolean rotateString(String s, String goal) {
        int n = s.length(), m = goal.length();
        if (m != n) return false;

        for (int offset = 0; offset < n; offset++) {
            if (isMatch(s, goal, offset)) return true;
        }
        return false;
    }

    private boolean isMatch(String s, String g, int offset) {
        int n = s.length();
        for (int si = 0; si < n; si++) {
            int gi = (si + offset) % n;
            if (s.charAt(si) != g.charAt(gi)) return false;
        }
        return true;
    }
}
class Solution {
public:
    bool rotateString(string s, string goal) {
        if(s.size()!=goal.size()){
            return false;
        }
        string temp=s+s;
        if(temp.find(goal)!=-1){
            return true;
        }
        return false;
    }
};
var rotateString = function(s, goal) {
   const n = s.length;
   for(let i = 0; i < n; i++) {
      s = s.substring(1) + s[0];
      if(s === goal) return true;
   }
   return false;
};
Rotate String