Todos los desafíos
Fácil 0 resueltos 0% de aceptación

Palindrome String

Check whether text reads the same forwards and backwards.

Decide whether text is a palindrome, considering only letters and digits and ignoring case.

Implement is_palindrome(text).

Input

text: The text to check (ASCII characters).

Output

Return true for a palindrome, otherwise false.

Restricciones

0 ≤ length ≤ 10,000

Ejemplos

Ejemplo 1
Entrada:
text = "Racecar"

Salida esperada:
expected = True
Entrada:
std::string text = "Racecar";

Salida esperada:
bool expected = true;
Entrada:
string text = "Racecar";

Salida esperada:
bool expected = true;

Explicación

Lowercased, "racecar" reads the same both ways.

Ejemplo 2
Entrada:
text = "hello"

Salida esperada:
expected = False
Entrada:
std::string text = "hello";

Salida esperada:
bool expected = false;
Entrada:
string text = "hello";

Salida esperada:
bool expected = false;

Explicación

"hello" backwards is "olleh", which is different.

Referencias

Este reto está adaptado para CodeUtility. Sigue el enunciado y las restricciones indicadas arriba.

Aprende de otros

Soluciones de la comunidad

Aún no hay soluciones publicadas. Resuelve este reto para compartir la primera.