Check if string s can become goal after some rotations.
If s+s contains goal, then goal is a rotation of s.
- Check lengths match
- Concatenate s+s
- Check if goal is a substring of s+s
- Time Complexity: O(n^2) with contains
- Space Complexity: O(n)
Check if string s can become goal after some rotations.
If s+s contains goal, then goal is a rotation of s.