From b064d08fb8d717c46f641d9ad8977aec61067e99 Mon Sep 17 00:00:00 2001 From: HYUNAHKO Date: Sat, 15 Nov 2025 01:33:55 +0900 Subject: [PATCH 1/8] contains-duplicate solution --- contains-duplicate/HYUNAHKO.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 contains-duplicate/HYUNAHKO.py diff --git a/contains-duplicate/HYUNAHKO.py b/contains-duplicate/HYUNAHKO.py new file mode 100644 index 000000000..b47b9ae79 --- /dev/null +++ b/contains-duplicate/HYUNAHKO.py @@ -0,0 +1,10 @@ +class Solution: + def containsDuplicate(self, nums: List[int]) -> bool: + if len(nums) >= 1 and len(nums) <= 100000: + for i in range(0, len(nums)): + src = nums[i] + for j in range(i+1, len(nums)): + if src == nums[j]: + return True + return False + return False \ No newline at end of file From de919976522a9f1c3b0093fc9d5965d33c3a4962 Mon Sep 17 00:00:00 2001 From: HYUNAHKO Date: Sat, 15 Nov 2025 01:40:25 +0900 Subject: [PATCH 2/8] contains-duplicate solution --- contains-duplicate/HYUNAHKO.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contains-duplicate/HYUNAHKO.py b/contains-duplicate/HYUNAHKO.py index b47b9ae79..0537b50f2 100644 --- a/contains-duplicate/HYUNAHKO.py +++ b/contains-duplicate/HYUNAHKO.py @@ -7,4 +7,5 @@ def containsDuplicate(self, nums: List[int]) -> bool: if src == nums[j]: return True return False - return False \ No newline at end of file + return False + \ No newline at end of file From e594a4bd0c242a7966ade71b19be7aceae54ae5e Mon Sep 17 00:00:00 2001 From: HYUNAHKO Date: Sat, 15 Nov 2025 01:54:28 +0900 Subject: [PATCH 3/8] two-sum solution --- two-sum/HYUNAHKO.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 two-sum/HYUNAHKO.py diff --git a/two-sum/HYUNAHKO.py b/two-sum/HYUNAHKO.py new file mode 100644 index 000000000..a991c2a42 --- /dev/null +++ b/two-sum/HYUNAHKO.py @@ -0,0 +1,12 @@ +class Solution: + def twoSum(self, nums: List[int], target: int) -> List[int]: + result = [] + if len(nums) >= 2 and len(nums) <= 1e4: + for idx1, i in enumerate(nums): + num1 = i + for idx2 in range(idx1+1, len(nums)): + num2 = nums[idx2] + if ((num1 + num2) == target): + result.append(idx1) + result.append(idx2) + return result From 0b11f2089503317a889366ffc6b276dec83b0523 Mon Sep 17 00:00:00 2001 From: HYUNAHKO Date: Sat, 15 Nov 2025 10:49:29 +0900 Subject: [PATCH 4/8] top-k solution --- top-k-frequent-elements/HYUNAHKO.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 top-k-frequent-elements/HYUNAHKO.py diff --git a/top-k-frequent-elements/HYUNAHKO.py b/top-k-frequent-elements/HYUNAHKO.py new file mode 100644 index 000000000..36cf8e930 --- /dev/null +++ b/top-k-frequent-elements/HYUNAHKO.py @@ -0,0 +1,13 @@ +class Solution: + def topKFrequent(self, nums: List[int], k: int) -> List[int]: + value_dict = {} + + for num in nums: + if num in value_dict: + value_dict[num] += 1 + else: + value_dict[num] = 1 + + sorted_items = sorted(value_dict.items(), key=lambda x: x[1], reverse=True) + + return [key for key, value in sorted_items[:k]] \ No newline at end of file From 19ee8c70a384b91753763ae6ff2dcc7172288299 Mon Sep 17 00:00:00 2001 From: HYUNAHKO Date: Sat, 15 Nov 2025 10:50:19 +0900 Subject: [PATCH 5/8] top-k solution --- top-k-frequent-elements/HYUNAHKO.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/top-k-frequent-elements/HYUNAHKO.py b/top-k-frequent-elements/HYUNAHKO.py index 36cf8e930..a28709235 100644 --- a/top-k-frequent-elements/HYUNAHKO.py +++ b/top-k-frequent-elements/HYUNAHKO.py @@ -10,4 +10,5 @@ def topKFrequent(self, nums: List[int], k: int) -> List[int]: sorted_items = sorted(value_dict.items(), key=lambda x: x[1], reverse=True) - return [key for key, value in sorted_items[:k]] \ No newline at end of file + return [key for key, value in sorted_items[:k]] + \ No newline at end of file From c6121c6f583c01e705539642eb70739e0c0274bb Mon Sep 17 00:00:00 2001 From: HYUNAHKO Date: Sat, 15 Nov 2025 10:54:02 +0900 Subject: [PATCH 6/8] two-sum solution --- two-sum/HYUNAHKO.py | 1 + 1 file changed, 1 insertion(+) diff --git a/two-sum/HYUNAHKO.py b/two-sum/HYUNAHKO.py index a991c2a42..8c0740f28 100644 --- a/two-sum/HYUNAHKO.py +++ b/two-sum/HYUNAHKO.py @@ -10,3 +10,4 @@ def twoSum(self, nums: List[int], target: int) -> List[int]: result.append(idx1) result.append(idx2) return result + From a418559ce40921b64f9d3ae9e8757d725ada05fe Mon Sep 17 00:00:00 2001 From: HYUNAHKO Date: Sat, 15 Nov 2025 11:06:30 +0900 Subject: [PATCH 7/8] contains-duplicate newline solution --- contains-duplicate/HYUNAHKO.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contains-duplicate/HYUNAHKO.py b/contains-duplicate/HYUNAHKO.py index 0537b50f2..6a11d6a03 100644 --- a/contains-duplicate/HYUNAHKO.py +++ b/contains-duplicate/HYUNAHKO.py @@ -8,4 +8,4 @@ def containsDuplicate(self, nums: List[int]) -> bool: return True return False return False - \ No newline at end of file + From 6214075439446e83bb58160c21e674e472abfcab Mon Sep 17 00:00:00 2001 From: HYUNAHKO Date: Sat, 15 Nov 2025 11:11:10 +0900 Subject: [PATCH 8/8] top-k newline solution --- top-k-frequent-elements/HYUNAHKO.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/top-k-frequent-elements/HYUNAHKO.py b/top-k-frequent-elements/HYUNAHKO.py index a28709235..0144392e3 100644 --- a/top-k-frequent-elements/HYUNAHKO.py +++ b/top-k-frequent-elements/HYUNAHKO.py @@ -11,4 +11,4 @@ def topKFrequent(self, nums: List[int], k: int) -> List[int]: sorted_items = sorted(value_dict.items(), key=lambda x: x[1], reverse=True) return [key for key, value in sorted_items[:k]] - \ No newline at end of file +