Synced the directory structure to that of Python repo

This commit is contained in:
Varun Upadhyay
2017-10-13 06:57:26 -07:00
parent 7dd8fd16cc
commit e53249ba23
25 changed files with 0 additions and 0 deletions

16
Others/Palindrome.java Normal file
View File

@ -0,0 +1,16 @@
class Palindrome {
public String reverseString(String x){ //*helper method
String output = "";
for(int i=x.length()-1; i>=0; i--){
output += x.charAt(i); //addition of chars create String
}
return output;
}
public Boolean isPalindrome(String x){ //*palindrome method, returns true if palindrome
return (x.equalsIgnoreCase(reverseString(x)));
}
}