@@ -0,0 +1,1358 @@
+// Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.%0A%0A// For example,%0A// %22A man, a plan, a canal: Panama%22 is a palindrome.%0A// %22race a car%22 is not a palindrome.%0A%0A// Note:%0A// Have you consider that the string might be empty? This is a good question to ask during an interview.%0A%0A// For the purpose of this problem, we define empty string as valid palindrome.%0A%0Apublic class Solution %7B%0A    public boolean isPalindrome(String s) %7B%0A    %09s = s.trim();%0A    %09int len = s.length();%0A%0A    %09if(len == 0) return true;%0A%0A    %09int start = 0; %0A    %09int end = len - 1;%0A%0A    %09while(start %3C end)%7B%0A    %09%09while(start %3C len - 1 && !validChar(s.charAt(start)))%7B%0A    %09%09%09start++;%0A    %09%09%7D%0A%0A    %09%09while(end %3E= 0 && !validChar(s.charAt(end)) )%7B%0A    %09%09%09end--;%0A    %09%09%7D%0A%0A    %09%09if(start %3E= end)%7B%0A    %09%09%09return true;%0A    %09%09%7D%0A%0A    %09%09if(start %3C len - 1 && end %3E= 0 && match(s.charAt(start), s.charAt(end)))%7B%0A    %09%09%09start++;%0A    %09%09%09end--;%0A    %09%09%7Delse%7B%0A    %09%09%09return false;%0A    %09%09%7D%0A    %09%7D%0A%0A    %09return true;%0A    %7D%0A%0A    public boolean validChar(char c)%7B%0A    %09boolean upper = c %3C= 'Z' && c %3E= 'A';%0A    %09boolean lower = c %3C= 'z' && c %3E= 'a';%0A    %09boolean num = c %3E= '0' && c %3C= '9';%0A    %09return upper %7C%7C lower %7C%7C num;%0A    %7D%0A%0A    public boolean match(char a, char b)%7B%0A    %09return (a - b == 32 %7C%7C a - b == -32 %7C%7C a == b)? true : false;%0A    %7D%0A%7D

add valid palindrome solution