Solución

@evhorus·25/6/2026TypeScript
solution.tsTypeScript
public class Solution {
    public boolean isPalindrome(String text) {

        if (text.length() == 0 || text.length()== 1){
            return true;
        }


        String normalizedText = text.toLowerCase();

        StringBuilder reversedText = new StringBuilder();

        for (int i = text.length() - 1 ; i >= 0 ;i--){
            reversedText.append(normalizedText.toCharArray()[i]);
        }
        
        return reversedText.toString().equals(normalizedText);
    }
}
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.