public class Rotation{
public static void main(String args[]){
System.out.println(Rotation.isRotation("ashish","hishas"));
}
static boolean isRotation(String actual, String checkString){
if(actual.length() != checkString.length())
return false;
if((checkString+checkString).indexOf(actual)!=-1)
return true;
else
return false;
}
}
public static void main(String args[]){
System.out.println(Rotation.isRotation("ashish","hishas"));
}
static boolean isRotation(String actual, String checkString){
if(actual.length() != checkString.length())
return false;
if((checkString+checkString).indexOf(actual)!=-1)
return true;
else
return false;
}
}
No comments:
Post a Comment