Problem
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.
Constraints
0 ≤ length ≤ 10,000
Examples
Example 1
Input:
text = "Racecar"
Expected output:
expected = True
Input:
std::string text = "Racecar";
Expected output:
bool expected = true;
Input:
string text = "Racecar";
Expected output:
bool expected = true;
Explanation
Lowercased, "racecar" reads the same both ways.
Example 2
Input:
text = "hello"
Expected output:
expected = False
Input:
std::string text = "hello";
Expected output:
bool expected = false;
Input:
string text = "hello";
Expected output:
bool expected = false;
Explanation
"hello" backwards is "olleh", which is different.
References
This challenge is adapted for CodeUtility. Follow the statement and constraints above.