Skip to content

Commit 2fd293c

Browse files
committed
add solution
1 parent 120d145 commit 2fd293c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @param {number} x
3+
* @return {boolean}
4+
*/
5+
var isPalindrome = function(x) {
6+
let str = x + ""
7+
let left = 0,right = str.length - 1
8+
while(left < right){
9+
if (str[left] != str[right]) return false
10+
left++
11+
right--
12+
}
13+
return true
14+
};

0 commit comments

Comments
 (0)