Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nickforce/19b0efd3e8af2efded49f8ebe6880cdb to your computer and use it in GitHub Desktop.
Save nickforce/19b0efd3e8af2efded49f8ebe6880cdb to your computer and use it in GitHub Desktop.
Palindrome Number (leetcode)
/**
* @param {number} x
* @return {boolean}
*/
var isPalindrome = function(x) {
if(x < 0) return false;
if(x == 0) return true;
if(x.toFixed(0).split('').reverse().join('')-0 == x) return true;
return false;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment