Created
December 7, 2017 04:01
-
-
Save jryebread/9a3300ef3778929761ae8d4383a7291b 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 boolean isPalindrome(String str) { | |
Pattern pattern = Pattern.compile("\\([a-z]\\)\\([a-z]\\)[a-z]\\2\\1"); | |
Matcher matcher = pattern.matcher(str); | |
if(matcher.find()) | |
return true; | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment