Problema
Decide whether text reads the same forwards and backwards, considering only letters and digits and ignoring case. Solve it recursively: compare the outer characters, then check the inside.
Implement is_palindrome_recursive(text).
Input
text: The text to check (ASCII characters).
Output
Return true for a palindrome, otherwise false.
Restrições
0 ≤ length ≤ 1,000
Exemplos
Entrada:
text = "Never odd or even"
Saída esperada:
expected = True
Entrada:
std::string text = "Never odd or even";
Saída esperada:
bool expected = true;
Entrada:
string text = "Never odd or even";
Saída esperada:
bool expected = true;
Explicação
Letters only, lowercased: "neveroddoreven" reads the same both ways.
Entrada:
text = "code"
Saída esperada:
expected = False
Entrada:
std::string text = "code";
Saída esperada:
bool expected = false;
Entrada:
string text = "code";
Saída esperada:
bool expected = false;
Explicação
"c" and "e" differ, so it is not a palindrome.
Referências
Este desafio foi adaptado para o CodeUtility. Siga o enunciado e as restrições acima.