shah.hiral15
BAN USER
public static void main (String[] args) throws java.lang.Exception{
String cleanInput = cleanStr("L*&EVe)))l");
boolean isPal = isPalM(cleanInput);
System.out.println("the input string without special chars is "+ cleanInput + " & ispallindrome:" + isPal);
}
public static boolean isPalM(String input){
if(input.length() <=1)
return true;
else
return isPalRec(input, 0, (input.length()-1));
}
public static boolean isPalRec(String str, int s, int e){
if(s==e)
return true;
if(str.charAt(s) != str.charAt(e))
return false;
if(s < e-1)
isPalRec(str, s+1, e-1);
return true;
}
public static String cleanStr(String input){
Pattern escaper = Pattern.compile("([^a-zA-z0-9])");
String newStr = escaper.matcher(input).replaceAll("");
//System.out.println(input + " " + newStr);
return newStr.toLowerCase();
}
Repkaylafgioia, Cloud Support Associate at Absolute Softech Ltd
Hi, I am Kayla from Elkins USA. I am working as Project management and I have professional 3-year experience in ...
RepOliviaJBlack, Consultant at Apkudo
I am Olivia from San Diego. I am working as a checker in the Thom McAn Store company. My strong ...
RepMelodyTHeckler, abc at ABC TECH SUPPORT
Earned praised for my work lecturing about get love back by vashikaran. Spent childhood promoting art posters in Jacksonville, FL ...
Repashleymbosse, Associate at Accenture
I am an enthusiastic, hard-working and disciplined Catering Assistant with excellent track-record in working in the food industry. I am ...
Repcrystalblibby, Analyst at Achieve Internet
By professional i am teacher. Successfully supervised and assisted students, grade artwork, encouraged creativity and new technique.Familiar with art ...
Repedenwraye, Photographic spotter at Enrich Garden Services
I'm more of a Photographic spotter than an expert at creating beautiful, functional and personalised products for teachers, mentors ...
- shah.hiral15 March 19, 2018