We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0dcc0d8 commit 661aca2Copy full SHA for 661aca2
โvalid-palindrome/hozzijeong.jsโ
@@ -0,0 +1,11 @@
1
+/**
2
+ * @param {string} s
3
+ * @return {boolean}
4
+ */
5
+var isPalindrome = function(s) {
6
+ const lowercase = s.toLowerCase(); // ์๋ฌธ์๋ก ๋ณํ
7
+ const replacedString = lowercase.replaceAll(/[^a-z0-9]/g,''); // ์ ๊ทํํ์์ ํตํด ์์ด/์ซ์๊ฐ ์๋ ๊ฐ๋ค์ ''๋ก ๋ณํ
8
+
9
10
+ return replacedString === [...replacedString].reverse().join('') // ๊ธฐ์กด ๋ฌธ์์ด๊ณผ ๊ทธ ๊ฐ์ ๋ค์ง์ ๋ฌธ์์ด์ด ๊ฐ์์ง ๋น๊ต
11
+};
0 commit comments