Skip to content

Instantly share code, notes, and snippets.

@haskellcamargo
Last active October 27, 2016 22:06
Show Gist options
  • Select an option

  • Save haskellcamargo/8450ff5134728e62380c96893de875ef to your computer and use it in GitHub Desktop.

Select an option

Save haskellcamargo/8450ff5134728e62380c96893de875ef to your computer and use it in GitHub Desktop.
public static boolean isPalindorme(String word) {
int ahead = 0;
int behind = word.length - 1;
while (behind > ahead) {
if (word[ahead] != word[behind]) { return false; }
ahead++; behind--;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment