The level of palindrome

You have a natural number M. If it is not a palindrome, than we write it in back order and add it to natural number M. Steps is repeat till we will receive a number- palindrome. The quantity of operations we call the level of palindrome of natural number M.
Find the level of palindrome of number M.
Specifications
Input
One number Ì (0 < Ì < 10000).
Output
One number is the level of palindrome.
Problem information
Time Limit: 1 secondsMemory Limit: 64 MB
Balls for the passed test: 10
Complexity: 36% 303/477
Example
Example input865 |
Example output2 |
| ← Product | Problems | Certification → |
