标签:
Determine whether an integer is a palindrome. Do this without extra space.
利用余数构造倒置数再判断。
var isPalindrome = function(x) { var y = 0 var t = x while(t > 0){ y = y*10 + t%10 t = Math.floor(t/10) } if (x===y) return true else return false }
标签:
原文地址:http://www.cnblogs.com/lilixu/p/4591219.html