From 905d40bd93c7671fc32c1ab224f846358856ec91 Mon Sep 17 00:00:00 2001 From: yuj2n Date: Sat, 4 Apr 2026 23:24:04 +0900 Subject: [PATCH 1/3] =?UTF-8?q?solve:=20=EB=B6=80=EB=B6=84=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 --- ...66\200\353\266\204 \353\254\270\354\236\220\354\227\264.js" | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 "yujin-level0/Week48/\353\266\200\353\266\204 \353\254\270\354\236\220\354\227\264.js" diff --git "a/yujin-level0/Week48/\353\266\200\353\266\204 \353\254\270\354\236\220\354\227\264.js" "b/yujin-level0/Week48/\353\266\200\353\266\204 \353\254\270\354\236\220\354\227\264.js" new file mode 100644 index 0000000..d163c46 --- /dev/null +++ "b/yujin-level0/Week48/\353\266\200\353\266\204 \353\254\270\354\236\220\354\227\264.js" @@ -0,0 +1,3 @@ +function solution(str1, str2) { + return str2.includes(str1) ? 1 : 0; +} From 85fae29db0b213823f4a1930dc0b918bf8d5c4c1 Mon Sep 17 00:00:00 2001 From: yuj2n Date: Sat, 4 Apr 2026 23:24:08 +0900 Subject: [PATCH 2/3] =?UTF-8?q?solve:=20=EB=B6=80=EB=B6=84=20=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=EC=97=B4=EC=9D=B8=EC=A7=80=20=ED=99=95=EC=9D=B8?= =?UTF-8?q?=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...7\200 \355\231\225\354\235\270\355\225\230\352\270\260.js" | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 "yujin-level0/Week48/\353\266\200\353\266\204 \353\254\270\354\236\220\354\227\264\354\235\270\354\247\200 \355\231\225\354\235\270\355\225\230\352\270\260.js" diff --git "a/yujin-level0/Week48/\353\266\200\353\266\204 \353\254\270\354\236\220\354\227\264\354\235\270\354\247\200 \355\231\225\354\235\270\355\225\230\352\270\260.js" "b/yujin-level0/Week48/\353\266\200\353\266\204 \353\254\270\354\236\220\354\227\264\354\235\270\354\247\200 \355\231\225\354\235\270\355\225\230\352\270\260.js" new file mode 100644 index 0000000..c9950cc --- /dev/null +++ "b/yujin-level0/Week48/\353\266\200\353\266\204 \353\254\270\354\236\220\354\227\264\354\235\270\354\247\200 \355\231\225\354\235\270\355\225\230\352\270\260.js" @@ -0,0 +1,4 @@ +function solution(my_string, target) { + return +my_string.includes(target); +} +// boolean의 숫자화: true -> 1 / false -> 0 From d0305a09db92aa6ea3403161215e408c89842963 Mon Sep 17 00:00:00 2001 From: yuj2n Date: Sat, 4 Apr 2026 23:24:14 +0900 Subject: [PATCH 3/3] =?UTF-8?q?solve:=20=EB=82=B4=EC=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "yujin-level0/Week48/\353\202\264\354\240\201.js" | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 "yujin-level0/Week48/\353\202\264\354\240\201.js" diff --git "a/yujin-level0/Week48/\353\202\264\354\240\201.js" "b/yujin-level0/Week48/\353\202\264\354\240\201.js" new file mode 100644 index 0000000..3b1012c --- /dev/null +++ "b/yujin-level0/Week48/\353\202\264\354\240\201.js" @@ -0,0 +1,13 @@ +function solution(a, b) { + let result = 0; + for (let i = 0; i < a.length; i++) { + result += a[i] * b[i]; + } + return result; +} + +// 다른 풀이 +// array.reduce((누적값, 현재값, 인덱스, 원본배열) => { ... }, 초깃값) +function solution(a, b) { + return a.reduce((acc, cur, i) => acc + cur * b[i], 0); +}