Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” is not a palindrome. Note: Have you consider that the string might be empty? This is a good question to ask during an interview. For the purpose of this problem, we define empty string as valid palindrome.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
publicclassTest{ publicvoidadd(Byte b){ b = b++; } publicstaticvoidmain(String[] args){ Test test = new Test(); Byte a = 127; Byte b = 127; test.add(++a); System.out.print(a + " "); test.add(b); System.out.print(b + ""); } }
Code
1 2 3 4 5 6 7 8 9
publicstaticvoidmain(String[] args){ Test test = new Test(); Byte a = 127; Byte b = 127; test.add(++a); System.out.print(a + " "); test.add(b); System.out.print(b + ""); }
Implement strStr()
Problem
Implement strStr(). Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.