Check if string s can become goal after some rotations.

Input: s="abcde", goal="cdeab" → Output: true Input: s="abcde", goal="abced" → Output: false

If s+s contains goal, then goal is a rotation of s.

public boolean rotateString(String s, String goal) { return s.length() == goal.length() && (s + s).contains(goal); }