Created
October 12, 2022 07:07
-
-
Save OlegKorn/2a52e06653e16faf509ea7d191cdd2a2 to your computer and use it in GitHub Desktop.
leetcode - Palindrom.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
author Oleg Kornilov | |
[email protected] | |
github.com/OlegKorn | |
https://leetcode.com/problems/palindrome-number/solution/ | |
*/ | |
var isPalindrome = function(x) { | |
x = x.toString() | |
for (var i = 0; i < x.length; i++) { | |
if (x.charAt(i) !== x.charAt(x.length - 1 - i)) { | |
return false | |
} | |
} | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment