Problema
Ver traduçãoDecide 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.
Restrições
0 ≤ length ≤ 10,000
Exemplos
Exemplo 1
Entrada:
text = "Racecar"
Saída esperada:
expected = True
Entrada:
std::string text = "Racecar";
Saída esperada:
bool expected = true;
Entrada:
string text = "Racecar";
Saída esperada:
bool expected = true;
Explicação
Lowercased, "racecar" reads the same both ways.
Exemplo 2
Entrada:
text = "hello"
Saída esperada:
expected = False
Entrada:
std::string text = "hello";
Saída esperada:
bool expected = false;
Entrada:
string text = "hello";
Saída esperada:
bool expected = false;
Explicação
"hello" backwards is "olleh", which is different.
Referências
Este desafio foi adaptado para o CodeUtility. Siga o enunciado e as restrições acima.