Given an integer x, return true if x is palindrome integer.
An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not.
입출력 예
Input: x = 121
Output: true
Input: x = -121
Output: false
Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.
간단한 문제입니다.
입력 x를 reverse한 값이 x와 일치하는지 확인 작업만 하면 통과합니다.
var isPalindrome = function(x) {
x = x.toString();
let y = x.split('').reverse().join('');
return x === y;
};