From 22b9a572947affa69c9ed8bdbb7065b3e22d7bad Mon Sep 17 00:00:00 2001 From: Citizen <40601526+ViGilanteAF@users.noreply.github.com> Date: Sat, 21 Jan 2023 22:30:53 +0900 Subject: [PATCH 1/3] Basic Setup --- Week5/5397_KeyLogger.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Week5/5397_KeyLogger.js diff --git a/Week5/5397_KeyLogger.js b/Week5/5397_KeyLogger.js new file mode 100644 index 0000000..164407d --- /dev/null +++ b/Week5/5397_KeyLogger.js @@ -0,0 +1,10 @@ +// 2 +// <>Cd- +// ThIsIsS3Cr3t + +// BAPC +// ThIsIsS3Cr3t +function keylogger() { + + +} \ No newline at end of file From 041a6ee0020791f86253e2be54a51880e14975a1 Mon Sep 17 00:00:00 2001 From: HU SANG MIN <40601526+ViGilanteAF@users.noreply.github.com> Date: Thu, 16 Mar 2023 03:08:22 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EB=B0=A9=ED=96=A5=ED=82=A4=EC=97=90=20?= =?UTF-8?q?=EB=94=B0=EB=A5=B8=20=EC=9C=84=EC=B9=98=20=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=EC=99=BC=EC=AA=BD=EC=9C=BC=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= =?UTF-8?q?=EC=8B=9C=20=EC=9E=84=EC=8B=9C=EC=A0=80=EC=9E=A5=ED=9B=84=20?= =?UTF-8?q?=EC=98=A4=EB=A5=B8=EC=AA=BD=EC=9C=BC=EB=A1=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=ED=95=A0=EB=95=8C=20=EB=B6=99=EC=9D=B4=EA=B8=B0(join)?= =?UTF-8?q?=20=EB=B0=B0=EC=97=B4=202=EA=B0=9C=20=EC=84=A0=EC=96=B8=201?= =?UTF-8?q?=EA=B0=9C=EB=8A=94=20=EB=AC=B8=EC=9E=90=20=EC=A0=80=EC=9E=A5=20?= =?UTF-8?q?=ED=95=98=EB=A9=B4=EC=84=9C=20=ED=98=84=EC=9E=AC=EC=9C=84?= =?UTF-8?q?=EC=B9=98=ED=8C=8C=EC=95=85=201=EA=B0=9C=EB=8A=94=20=EB=B0=A9?= =?UTF-8?q?=ED=96=A5=ED=82=A4=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if 조건문을 이용해서 방향키에 따라 pop할거 설정, pop한문자 는 반대쪽 배열 에 연결 '-' 나오면 그냥 pop 마지막에 join으로 두배열 합치기 이때 문자를 빼서 저장한 공간 은 먼저 빠진 문자가 오른쪽 끝값으로 와야하기 때문에 reverse 를 해서 붙임 --- Week5/5397_KeyLogger.js | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Week5/5397_KeyLogger.js b/Week5/5397_KeyLogger.js index 164407d..502a867 100644 --- a/Week5/5397_KeyLogger.js +++ b/Week5/5397_KeyLogger.js @@ -1,10 +1,23 @@ -// 2 -// <>Cd- -// ThIsIsS3Cr3t +const input = require("fs").readFileSync("/Users/husangmin/Documents/GitHub/stdin").toString().trim().split("\n").map((str) => str.trim()) +const [T, ...Pwd] = input; -// BAPC -// ThIsIsS3Cr3t -function keylogger() { +function keylogger(T, Pwd) { + Pwd.map((pwd) => { + let [answer, tmp] = [[], []]; + pwd.split("").map((str) => { + if (v === "<") { + if (answer.length !== 0) tmp.push(answer.pop()); + } else if (v === ">") { + if (tmp.length !== 0) answer.push(tmp.pop()); + } else if (v === "-") { + answer.pop(); + } else { + answer.push(str); + } + }); + console.log([...answer, ...tmp.reverse()].join("")); + }); +} -} \ No newline at end of file +keylogger(T, Pwd); \ No newline at end of file From 2f29dea0a71b2b9f881e46b18e6a661f10b90ee1 Mon Sep 17 00:00:00 2001 From: HU SANG MIN <40601526+ViGilanteAF@users.noreply.github.com> Date: Thu, 16 Mar 2023 03:13:08 +0900 Subject: [PATCH 3/3] link change --- Week5/5397_KeyLogger.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Week5/5397_KeyLogger.js b/Week5/5397_KeyLogger.js index 502a867..4645bbe 100644 --- a/Week5/5397_KeyLogger.js +++ b/Week5/5397_KeyLogger.js @@ -1,4 +1,4 @@ -const input = require("fs").readFileSync("/Users/husangmin/Documents/GitHub/stdin").toString().trim().split("\n").map((str) => str.trim()) +const input = require("fs").readFileSync("GitHub/stdin").toString().trim().split("\n").map((str) => str.trim()) const [T, ...Pwd] = input; function keylogger(T, Pwd) {