Skip to content

Instantly share code, notes, and snippets.

@kimki1124
Created August 6, 2017 13:00
Show Gist options
  • Save kimki1124/c14ba8ec3061d6f0f8cda173bec38bcc to your computer and use it in GitHub Desktop.
Save kimki1124/c14ba8ec3061d6f0f8cda173bec38bcc to your computer and use it in GitHub Desktop.
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