Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Palindrome-detection/Java/palindrome-detection-4.java
Normal file
14
Task/Palindrome-detection/Java/palindrome-detection-4.java
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
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