We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a467ea commit 054c27dCopy full SHA for 054c27d
README.md
@@ -4,4 +4,5 @@
4
|:---:|:---:|:---:|:---:|
5
|1|[两数之和](https://leetcode-cn.com/problems/two-sum/)|[JavaScript](./algorithms/two-sum.js)|Easy|
6
|2|[两数相加](https://leetcode-cn.com/problems/add-two-numbers/)|[JavaScript](./algorithms/add-two-numbers.js)|Medium|
7
+|9|[回文数](https://leetcode-cn.com/problems/palindrome-number/)|[JavaScript](./algorithms/palindrome-number.js)|Easy|
8
algorithms/palindrome-number.js
@@ -0,0 +1,15 @@
1
+/**
2
+ * @param {number} x
3
+ * @return {boolean}
+ */
+var isPalindrome = function (x) {
+ if (x < 0) {
+ return false
+ }
9
+
10
+ if (x.toString().split('').reverse().join('') === x.toString()) {
11
+ return true
12
13
14
15
+};
0 commit comments