Solución

@jessvsliskov_4bf47311·23/10/2026TypeScript
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
Respuestas

Aún no hay respuestas

¡Sé el primero en responder!

Escribir un comentario

Recuerda ser amable. Estás comentando la solución de otra persona. Comparte tu perspectiva de forma constructiva y respetuosa.

Debes iniciar sesión para publicar un comentario.