Skip to content

Instantly share code, notes, and snippets.

@hilda8519
Created June 23, 2014 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hilda8519/34e3624fa25453ccbaa7 to your computer and use it in GitHub Desktop.
Save hilda8519/34e3624fa25453ccbaa7 to your computer and use it in GitHub Desktop.
package isRotation;
import java.util.Arrays;
public class isRotation{
public static boolean isRotation(String s1, String s2) {
int len=s1.length();{
if(len==s2.length()&&len>0)
{
String s1s1=s1+s1;
return isSubstring(s1s1,s2);
}
return false;
}
}
private static boolean isSubstring(String s1s1, String s2) {
// TODO Auto-generated method stub
return false;
}
public static void main(String args[]) {
String s1 = "erbottlewat";
String s2 = "water";
System.out.println(isRotation(s2, s1));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment