Created
June 23, 2014 17:53
-
-
Save iwilbert/77a2aa34ab66cdbbb4b5 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
public boolean isRotate(String s1, String s2) { | |
if(s1 == null || s2 == null || s1.isEmpty() || s2.isEmpty() || s1.length() != s2.length()) | |
return false; | |
else | |
return isSubstring(s1+s1, s2); | |
} | |
private boolean isSubstring(String s1, String s2) { | |
return s1.contains(s2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment