Created
August 6, 2017 13:00
-
-
Save kimki1124/c14ba8ec3061d6f0f8cda173bec38bcc 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 static int bestPractice(String first, String second){ | |
if (first.length() != second.length()) | |
return -1; | |
return (second + second).indexOf(first); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment