Functions
Function-39
Function-40
Function-41
~/algor $ cat problems/funksiya-palindrom-sonlar
Palindrome number
Easy
1000 ms
128 MB
30%
Write a function IsPalindrome(x) that returns true if the positive integer $x$ is a palindrome and false otherwise. A number is a palindrome if it reads the same from left to right and from right to left.
Example 1: IsPalindrome(121) → true
Example 2: IsPalindrome(123) → false
Write only the function body.
Input
One line with a positive integer $x$ — the argument of the function.
Output
The value returned by the function: true or false.
Note
$1 \le x \le 10^{9}$
Examples
Input #1
121
Output #1
true
Input #2
123
Output #2
false