Created
June 23, 2014 23:19
-
-
Save hilda8519/34e3624fa25453ccbaa7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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