From 26d9c714f4ca41e9edc525fa7eaafbcc960b8ab1 Mon Sep 17 00:00:00 2001 From: sik9252 Date: Thu, 19 Mar 2026 23:48:55 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20ContainsDuplicate=20=ED=92=80?= =?UTF-8?q?=EC=9D=B4=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sik9252/ ContainsDuplicate.js | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sik9252/ ContainsDuplicate.js diff --git a/sik9252/ ContainsDuplicate.js b/sik9252/ ContainsDuplicate.js new file mode 100644 index 0000000..f3e3122 --- /dev/null +++ b/sik9252/ ContainsDuplicate.js @@ -0,0 +1,4 @@ +var containsDuplicate = function (nums) { + const removeDuplicate = new Set(nums); + return nums.length === removeDuplicate.size ? false : true; +}; From 07a1ac23fec398c3b3a6fe865dd66decdbc9410a Mon Sep 17 00:00:00 2001 From: sik9252 Date: Thu, 19 Mar 2026 23:49:05 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20RomanToInteger=20=ED=92=80=EC=9D=B4?= =?UTF-8?q?=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sik9252/ RomanToInteger.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sik9252/ RomanToInteger.js diff --git a/sik9252/ RomanToInteger.js b/sik9252/ RomanToInteger.js new file mode 100644 index 0000000..feba44a --- /dev/null +++ b/sik9252/ RomanToInteger.js @@ -0,0 +1,26 @@ +var romanToInt = function (s) { + const map = { + I: 1, + V: 5, + X: 10, + L: 50, + C: 100, + D: 500, + M: 1000, + }; + + let result = 0; + + for (let i = 0; i < s.length; i++) { + const current = map[s[i]]; + const next = map[s[i + 1]]; + + if (current < next) { + result -= current; + } else { + result += current; + } + } + + return result; +};