Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Gary Daniels and Evan Goldring - Mock whiteboard problem
Oct 03, 2005 at 8:55 PMpublic static boolean findPolyndrom(String polynd) {
if (polynd == null || "".equals(polynd = polynd.toLowerCase().trim())) {
return false;
}
int index = 0;
int length = polynd.length();
char forward = 0;
char reverse = 0;
boolean isValidString = false;
while (index < length) {
while(!Character.isLetterOrDigit(forward = polynd.charAt(index++))) {
if (index >= length) {
return isValidString;
}
}
while(!Character.isLetterOrDigit(reverse = polynd.charAt(--length))) {
if (length <= index) {
return isValidString;
}
}
isValidString = true;
if (forward != reverse) {
return false;
}
if (length <= index) {
break;
}
}
return true;
}