Solución
solution.tsTypeScript
public class Solution {
public boolean isPalindrome(String text) {
if (text == null) return false;
if (text.length() <= 1) return true;
int left = 0;
int right = text.length() - 1;
while (left < right) {
char leftChar = Character.toUpperCase(text.charAt(left));
char rightChar = Character.toUpperCase(text.charAt(right));
if (leftChar != rightChar) return false;
left++;
right--;
}
return true;
}
}0respuestas