We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0d10529 + 6d3c846 commit 86ac332Copy full SHA for 86ac332
1 file changed
Misc/Palindrome.java
@@ -0,0 +1,16 @@
1
+class Palindrome {
2
+
3
+ public String reverseString(String x){ //*helper method
4
+ String output = "";
5
+ for(int i=x.length()-1; i>=0; i--){
6
+ output += x.charAt(i); //addition of chars create String
7
+ }
8
+ return output;
9
10
11
12
+ public Boolean isPalindrome(String x){ //*palindrome method, returns true if palindrome
13
+ return (x.equalsIgnoreCase(reverseString(x)));
14
15
16
0 commit comments