refactored isPalindromicNum using lists as a stack