Given two strings s and goal, return true if and only if s can become goal after some number of rotations.
A rotation moves the leftmost character of the string to the rightmost end. For example, rotating "abcde" once produces "bcdea".
An equivalent way to think about the problem is: goal is a rotation of s if the two strings have the same length and goal appears inside s + s.
Input / output
s: string, goal: stringboolean1 <= s.length, goal.length <= 100s and goal consist of lowercase English letters.How would you check whether goal is a rotation of s without explicitly building the doubled string s + s?