class Solution {
public boolean rotateString(String s, String goal) {
return s.length() == goal.length() && (s+s).contains(goal);
}
}
判断条件:
1,两个字符串长度相等
2,拼接两个s,新的字符串包含goal字符串
class Solution {
public boolean rotateString(String s, String goal) {
return s.length() == goal.length() && (s+s).contains(goal);
}
}
判断条件:
1,两个字符串长度相等
2,拼接两个s,新的字符串包含goal字符串