From 9e92de88fd6e72f6a0facd3e563e33ffbf4f017c Mon Sep 17 00:00:00 2001 From: suKyoung Date: Mon, 1 Dec 2025 19:06:55 +0900 Subject: [PATCH 1/2] =?UTF-8?q?add:=203-1=20=ED=9A=8C=EB=AC=B8=20=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=EC=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...70\353\254\270\354\236\220\354\227\264.js" | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 "src/inflearn_coding_test/basic/3-1_\355\232\214\353\254\270\353\254\270\354\236\220\354\227\264.js" diff --git "a/src/inflearn_coding_test/basic/3-1_\355\232\214\353\254\270\353\254\270\354\236\220\354\227\264.js" "b/src/inflearn_coding_test/basic/3-1_\355\232\214\353\254\270\353\254\270\354\236\220\354\227\264.js" new file mode 100644 index 0000000..b895ce7 --- /dev/null +++ "b/src/inflearn_coding_test/basic/3-1_\355\232\214\353\254\270\353\254\270\354\236\220\354\227\264.js" @@ -0,0 +1,19 @@ +function solution(str) { + const newStr = str.toLowerCase(); + let isPalindrome = false; + + for (let i = 0; i < newStr.length / 2; i++) { + if (newStr[i] !== newStr[newStr.length - i - 1]) { + isPalindrome = false; + return isPalindrome; + } else { + isPalindrome = true; + } + } + + return isPalindrome; +} + +console.log(solution('gooG')); // true +console.log(solution('aba')); // true +console.log(solution('abca')); // false From 7ac9b50f02ccca202e63b9c309c712d09210ff73 Mon Sep 17 00:00:00 2001 From: suKyoung Date: Mon, 1 Dec 2025 19:20:52 +0900 Subject: [PATCH 2/2] =?UTF-8?q?add:=203-2=20=ED=8E=A0=EB=A6=B0=EB=93=9C?= =?UTF-8?q?=EB=A1=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...240\353\246\260\353\223\234\353\241\254.js" | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 "src/inflearn_coding_test/basic/3-2_\355\216\240\353\246\260\353\223\234\353\241\254.js" diff --git "a/src/inflearn_coding_test/basic/3-2_\355\216\240\353\246\260\353\223\234\353\241\254.js" "b/src/inflearn_coding_test/basic/3-2_\355\216\240\353\246\260\353\223\234\353\241\254.js" new file mode 100644 index 0000000..fc5755a --- /dev/null +++ "b/src/inflearn_coding_test/basic/3-2_\355\216\240\353\246\260\353\223\234\353\241\254.js" @@ -0,0 +1,18 @@ +function solution(str) { + const newStr = str.toLowerCase().replace(/[^a-z]/g, ''); + let isPalindrome = false; + + for (let i = 0; i < newStr.length / 2; i++) { + if (newStr[i] !== newStr[newStr.length - i - 1]) { + isPalindrome = false; + return isPalindrome; + } else { + isPalindrome = true; + } + } + + return isPalindrome; +} + +console.log(solution('found7, time: study; Yduts; emit, 7Dnuof')); // YES +console.log(solution('sungminkim')); // NO