Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions 28. 문자열/LeetCode/9. Palindrome Number.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @param {number} x
* @return {boolean}
*/
const isPalindrome = function (x) {
if (x < 0) return false;

const array = [...String(x)];
for (let i = 0; i < array.length / 2; i++) {
if (array[i] !== array[array.length - 1 - i]) return false;
}

return true;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Explanation: ' 부분은 구현 안하셨나요??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 처음 이 문제 받았을 때는 구현을 했었는데요~!
리트코드에서 그냥 넣어주는 거였더라고요🤣

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

바뀐 구현 방법이 코드가 간결하고 더 쉽게 구현이 되는것 같습니다.
10ms 라도 빨라진게 많이 바뀐것일 겁니다.
👍 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제 PR 글 내용도 읽어보시는군여😏

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

당근 다봐야죠 ㅎㅎㅎㅎ