मध्यम 0 हल किए गए 0% स्वीकृति

Recursive Palindrome

Check a palindrome recursively, ignoring case and punctuation.

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.

सीमाएँ

0 ≤ length ≤ 1,000

उदाहरण

उदाहरण 1
इनपुट:
text = "Never odd or even"

अपेक्षित आउटपुट:
expected = True
इनपुट:
std::string text = "Never odd or even";

अपेक्षित आउटपुट:
bool expected = true;
इनपुट:
string text = "Never odd or even";

अपेक्षित आउटपुट:
bool expected = true;

व्याख्या

Letters only, lowercased: "neveroddoreven" reads the same both ways.

उदाहरण 2
इनपुट:
text = "code"

अपेक्षित आउटपुट:
expected = False
इनपुट:
std::string text = "code";

अपेक्षित आउटपुट:
bool expected = false;
इनपुट:
string text = "code";

अपेक्षित आउटपुट:
bool expected = false;

व्याख्या

"c" and "e" differ, so it is not a palindrome.

संदर्भ

यह चुनौती CodeUtility के लिए अनुकूलित की गई है। ऊपर दिए गए स्टेटमेंट और सीमाओं का पालन करें।

दूसरों से सीखें

समुदाय समाधान

अभी तक कोई प्रकाशित समाधान नहीं। पहला साझा करने के लिए इस चुनौती को हल करें।