public class RotationalString
OUTPUT of the above program is
true
false
{
public boolean
checkRotationalString(String s1, String s2)
{
return (s1.length() ==
s2.length()) && ((s1 + s1).indexOf(s2) != -1);
}
public static void main(String[] args)
{
RotationalString rs = new RotationalString();
System.out.println(rs.checkRotationalString("null", "ulln"));
System.out.println(rs.checkRotationalString("null", "llun"));
}
}
OUTPUT of the above program is
true
false