समस्या
अनुवाद दिखाएँ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 के लिए अनुकूलित की गई है। ऊपर दिए गए स्टेटमेंट और सीमाओं का पालन करें।