Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
|
|
@ -1,3 +1,14 @@
|
|||
public static boolean pali(String testMe){
|
||||
return testMe.matches("|(?:(.)(?<=(?=^.*?(\\1\\2?)$).*))+(?<=(?=^\\2$).*)");
|
||||
public static boolean rPali(String testMe){
|
||||
int strLen = testMe.length();
|
||||
return rPaliHelp(testMe, strLen-1, strLen/2, 0);
|
||||
}
|
||||
|
||||
public static boolean rPaliHelp(String testMe, int strLen, int testLen, int index){
|
||||
if(index > testLen){
|
||||
return true;
|
||||
}
|
||||
if(testMe.charAt(index) != testMe.charAt(strLen-index)){
|
||||
return false;
|
||||
}
|
||||
return rPaliHelp(testMe, strLen, testLen, index + 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue