Einfach 0 gelöst 0% Erfolgsquote

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.

Einschränkungen

0 ≤ length ≤ 10,000

Beispiele

Beispiel 1
Eingabe:
text = "Racecar"

Erwartete Ausgabe:
expected = True
Eingabe:
std::string text = "Racecar";

Erwartete Ausgabe:
bool expected = true;
Eingabe:
string text = "Racecar";

Erwartete Ausgabe:
bool expected = true;

Erläuterung

Lowercased, "racecar" reads the same both ways.

Beispiel 2
Eingabe:
text = "hello"

Erwartete Ausgabe:
expected = False
Eingabe:
std::string text = "hello";

Erwartete Ausgabe:
bool expected = false;
Eingabe:
string text = "hello";

Erwartete Ausgabe:
bool expected = false;

Erläuterung

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

Referenzen

Diese Aufgabe wurde für CodeUtility angepasst. Beachte die oben genannten Vorgaben und Einschränkungen.

Von anderen lernen

Community-Lösungen

Noch keine veröffentlichten Lösungen. Löse die Aufgabe und teile als Erster eine Lösung.