From 303307cd2c90d99780ebfcb93cc1338baa7d6951 Mon Sep 17 00:00:00 2001 From: yuj2n Date: Thu, 2 Oct 2025 11:47:28 +0900 Subject: [PATCH 1/2] =?UTF-8?q?solve:=20=EB=B0=B0=EC=97=B4=20=EB=91=90=20?= =?UTF-8?q?=EB=B0=B0=20=EB=A7=8C=EB=93=A4=EA=B8=B0=20=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...53\260\260_\353\247\214\353\223\244\352\270\260.js" | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 "yujin-level0/Week22/\353\260\260\354\227\264_\353\221\220_\353\260\260_\353\247\214\353\223\244\352\270\260.js" diff --git "a/yujin-level0/Week22/\353\260\260\354\227\264_\353\221\220_\353\260\260_\353\247\214\353\223\244\352\270\260.js" "b/yujin-level0/Week22/\353\260\260\354\227\264_\353\221\220_\353\260\260_\353\247\214\353\223\244\352\270\260.js" new file mode 100644 index 0000000..e8a9d1a --- /dev/null +++ "b/yujin-level0/Week22/\353\260\260\354\227\264_\353\221\220_\353\260\260_\353\247\214\353\223\244\352\270\260.js" @@ -0,0 +1,10 @@ +function solution(numbers) { + var answer = []; + answer = numbers.map(x=>x*2); + return answer; +} + +// 다른 풀이 +// function solution(numbers) { +// return numbers.reduce((a, b) => [...a, b * 2], []); +// } \ No newline at end of file From b2ed7012460b3f48d2a10d2af8c3358158afad29 Mon Sep 17 00:00:00 2001 From: yuj2n Date: Thu, 2 Oct 2025 11:47:40 +0900 Subject: [PATCH 2/2] =?UTF-8?q?solve:=20=EC=A4=91=EB=B3=B5=EB=90=9C=20?= =?UTF-8?q?=EC=88=AB=EC=9E=90=20=EA=B0=9C=EC=88=98=20=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...10\253\354\236\220_\352\260\234\354\210\230.js" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 "yujin-level0/Week22/\354\244\221\353\263\265\353\220\234_\354\210\253\354\236\220_\352\260\234\354\210\230.js" diff --git "a/yujin-level0/Week22/\354\244\221\353\263\265\353\220\234_\354\210\253\354\236\220_\352\260\234\354\210\230.js" "b/yujin-level0/Week22/\354\244\221\353\263\265\353\220\234_\354\210\253\354\236\220_\352\260\234\354\210\230.js" new file mode 100644 index 0000000..324e0ed --- /dev/null +++ "b/yujin-level0/Week22/\354\244\221\353\263\265\353\220\234_\354\210\253\354\236\220_\352\260\234\354\210\230.js" @@ -0,0 +1,14 @@ +function solution(array, n) { + let newArr = []; + for (let i = 0; i < array.length; i++) { + if (array[i] === n) { + newArr.push(array[i]); + } + } + return newArr.length; +} + +// 다른 풀이 +// function solution(array, n) { +// return array.filter(a => a === n).length; +// } \ No newline at end of file