Skip to content

Commit

Permalink
Update PalindromeChecker.java
Browse files Browse the repository at this point in the history
007cody authored Jan 28, 2025
1 parent 53047cb commit ef1091f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/java/PalindromeChecker.java
Original file line number Diff line number Diff line change
@@ -37,13 +37,21 @@ public void tester()
}
public boolean palindrome(String word)
{
//your code here
String output = new String ("");
for (int i=word.length(); i>0; i--){
output = output + word.substring(i-1,i);
}
if (word.equals(output)){
return true;
}
return false;
}
public String reverse(String str)
{
String sNew = new String();
//your code here
for (int i=str.length(); i>0; i--){
sNew = sNew + str.substring(i-1,i);
}
return sNew;
}
}

0 comments on commit ef1091f

Please sign in to comment.