212. Palindrome Number by Recursion
Foundation1000 ms256 MBSolved by 0%
Print Yes if n reads the same forwards and backwards, and No
otherwise.
121 -> Yes
123 -> No
7 -> Yes
A single digit is a palindrome. So is any number equal to its own reverse, and you already know how to reverse a number from problem 207.
Constraints - `0 ≤ n ≤ 2000000000`
Input
A single line containing one integer n.
Output
Print Yes or No on one line.
Input121
OutputYes
Noteis the standard example
Input123
OutputNo
Noteis not a palindrome
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.