/**
* @param {number} x
* @return {boolean}
*/
var isPalindrome = function (x) {
if (x < 0) {
return false;
}
let num = x;
let reverse = 0;
while (num != 0) {
reverse = reverse * 10 + (num % 10);
num = ~~(num / 10);
}
return reverse === x;
};
标签:10,return,reverse,题解,num,LeetCode,回文 From: https://www.cnblogs.com/wangshaojiea/p/16776774.html本文由一文多发运营工具平台 EaseWriting 发布