Skip to content

Commit

Permalink
Update PalindromeChecker.java
Browse files Browse the repository at this point in the history
  • Loading branch information
007cody authored Jan 30, 2025
1 parent ef1091f commit 7e80ee9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/PalindromeChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public boolean palindrome(String word)
}
public String reverse(String str)
{
String sNew = new String();
for (int i=str.length(); i>0; i--){
sNew = sNew + str.substring(i-1,i);
String output = new String ("");
for (int i=str.length(); i>0; i--){
output = output + str.substring(i-1,i);
}
return sNew;
return output;
}
}

0 comments on commit 7e80ee9

Please sign in to comment.