From cee6cc25db70f21f6e0927ef464e6687fb590d3a Mon Sep 17 00:00:00 2001 From: Kyojin Hwang Date: Mon, 28 Jul 2025 23:10:28 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat=20:=20valid-anagram=20=ED=92=80?= =?UTF-8?q?=EC=9D=B4=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- valid-anagram/Kyojin-Hwang.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 valid-anagram/Kyojin-Hwang.js diff --git a/valid-anagram/Kyojin-Hwang.js b/valid-anagram/Kyojin-Hwang.js new file mode 100644 index 000000000..8d45856c8 --- /dev/null +++ b/valid-anagram/Kyojin-Hwang.js @@ -0,0 +1,21 @@ +/** + * @param {string} s + * @param {string} t + * @return {boolean} + */ +var isAnagram = function(s, t) { + if (s.length !== t.length) return false; + + const count = {}; + + for (let char of s) { + count[char] = (count[char] || 0) + 1; + } + + for (let char of t) { + if (!count[char]) return false; // 없거나 개수가 0 + count[char]--; + } + + return true; +}; From fc2d28f5306b9862d71d6aa6af78e10a27228473 Mon Sep 17 00:00:00 2001 From: Owen Date: Wed, 30 Jul 2025 19:36:04 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat=20:=20climbing-stairs=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=ED=92=80=EC=9D=B4=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- climbing-stairs/Kyojin-Hwang.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 climbing-stairs/Kyojin-Hwang.js diff --git a/climbing-stairs/Kyojin-Hwang.js b/climbing-stairs/Kyojin-Hwang.js new file mode 100644 index 000000000..f2ec46b95 --- /dev/null +++ b/climbing-stairs/Kyojin-Hwang.js @@ -0,0 +1,18 @@ +/** + * @param {number} n + * @return {number} + */ +var climbStairs = function(n) { + if (n <= 2) return n; + + let prev1 = 1; + let prev2 = 2; + + for (let i = 3; i <= n; i++) { + const curr = prev1 + prev2; + prev1 = prev2; + prev2 = curr; + } + + return prev2; +}; \ No newline at end of file From 7cd49d863dc69c7ee3caf07192d72bd616950494 Mon Sep 17 00:00:00 2001 From: Owen Date: Wed, 30 Jul 2025 19:36:38 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix=20:=20=EA=B0=9C=ED=96=89=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- climbing-stairs/Kyojin-Hwang.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/climbing-stairs/Kyojin-Hwang.js b/climbing-stairs/Kyojin-Hwang.js index f2ec46b95..53660f07d 100644 --- a/climbing-stairs/Kyojin-Hwang.js +++ b/climbing-stairs/Kyojin-Hwang.js @@ -15,4 +15,4 @@ var climbStairs = function(n) { } return prev2; -}; \ No newline at end of file +}; From 321cd6da32a885849944bd065f7e9060ddaa84f2 Mon Sep 17 00:00:00 2001 From: owen Date: Fri, 1 Aug 2025 18:14:57 +0900 Subject: [PATCH 4/4] =?UTF-8?q?feat=20:=20=EB=AC=B8=EC=A0=9C=ED=92=80?= =?UTF-8?q?=EC=9D=B4=EC=99=84=EB=A3=8C=20-=201=EC=8B=9C=EA=B0=84=EB=8F=99?= =?UTF-8?q?=EC=95=88=20=ED=92=80=EC=A7=80=20=EB=AA=BB=ED=95=B4=EC=84=9C=20?= =?UTF-8?q?Gpt=20=ED=99=9C=EC=9A=A9=ED=95=B4=EC=84=9C=20=EB=AC=B8=EC=A0=9C?= =?UTF-8?q?=20=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- product-of-array-except-self/Kyojin-Hwang.js | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 product-of-array-except-self/Kyojin-Hwang.js diff --git a/product-of-array-except-self/Kyojin-Hwang.js b/product-of-array-except-self/Kyojin-Hwang.js new file mode 100644 index 000000000..b30cbf370 --- /dev/null +++ b/product-of-array-except-self/Kyojin-Hwang.js @@ -0,0 +1,24 @@ +/** + * @param {number[]} nums + * @return {number[]} + */ +var productExceptSelf = function (nums) { + const n = nums.length; + const answer = new Array(n).fill(1); + + // 왼쪽 곱 계산 + let prefix = 1; + for (let i = 0; i < n; i++) { + answer[i] = prefix; + prefix *= nums[i]; + } + + // 오른쪽 곱 계산 + let suffix = 1; + for (let i = n - 1; i >= 0; i--) { + answer[i] *= suffix; + suffix *= nums[i]; + } + + return answer; +};