आसान 0 हल किए गए 0% स्वीकृति

Palindrome Number

Check whether a number reads the same backwards.

Decide whether the decimal digits of n read the same forwards and backwards. Negative numbers are never palindromes because of the minus sign.

Implement is_palindrome_number(n).

Input

n: The number to check.

Output

Return true for a palindromic number, otherwise false.

सीमाएँ

-10¹⁸ ≤ n ≤ 10¹⁸

उदाहरण

उदाहरण 1
इनपुट:
n = 12321

अपेक्षित आउटपुट:
expected = True
इनपुट:
long long n = 12321;

अपेक्षित आउटपुट:
bool expected = true;
इनपुट:
long n = 12321;

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

व्याख्या

12321 reversed is 12321.

उदाहरण 2
इनपुट:
n = -121

अपेक्षित आउटपुट:
expected = False
इनपुट:
long long n = -121;

अपेक्षित आउटपुट:
bool expected = false;
इनपुट:
long n = -121;

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

व्याख्या

The minus sign makes "-121" differ from "121-".

संदर्भ

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

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

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

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