判断两个词是否为旋转词
public boolean isRotation(String a, String b){
if(a == null || b == null || a.length() != b.length()){
return false;
}
String str = b.concat(b);
return str.contains(a);
}
判断两个词是否为旋转词
public boolean isRotation(String a, String b){
if(a == null || b == null || a.length() != b.length()){
return false;
}
String str = b.concat(b);
return str.contains(a);
}