Refine the solution to palindrom number