What is the logic to check palindrome number