From db2a0849c62973da30d299a4d899c43be18f9beb Mon Sep 17 00:00:00 2001 From: Junhyeong Park Date: Sat, 15 Nov 2025 19:58:41 +0900 Subject: [PATCH 1/4] feat: solution --- contains-duplicate/jun-brro.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 contains-duplicate/jun-brro.py diff --git a/contains-duplicate/jun-brro.py b/contains-duplicate/jun-brro.py new file mode 100644 index 000000000..0965181e4 --- /dev/null +++ b/contains-duplicate/jun-brro.py @@ -0,0 +1,3 @@ +class Solution(object): + def containsDuplicate(self, nums): + return len(set(nums))!=len(nums) \ No newline at end of file From 9ae20507ad17dbab99121313b29a764295d18b75 Mon Sep 17 00:00:00 2001 From: Junhyeong Park Date: Sat, 15 Nov 2025 20:00:35 +0900 Subject: [PATCH 2/4] feat: solution --- two-sum/jun-brro.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 two-sum/jun-brro.py diff --git a/two-sum/jun-brro.py b/two-sum/jun-brro.py new file mode 100644 index 000000000..cb66a3f7b --- /dev/null +++ b/two-sum/jun-brro.py @@ -0,0 +1,6 @@ +class Solution(object): + def twoSum(self, nums, target): + for i in range(len(nums)): + for j in range(i + 1, len(nums)): + if nums[i] + nums[j] == target: + return [i, j] From bdd57299a6e2ae4c9ca2794455b8d4d0a98b0017 Mon Sep 17 00:00:00 2001 From: Junhyeong Park Date: Sat, 15 Nov 2025 20:03:53 +0900 Subject: [PATCH 3/4] feat: solution --- top-k-frequent-elements/jun-brro.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 top-k-frequent-elements/jun-brro.py diff --git a/top-k-frequent-elements/jun-brro.py b/top-k-frequent-elements/jun-brro.py new file mode 100644 index 000000000..170255a76 --- /dev/null +++ b/top-k-frequent-elements/jun-brro.py @@ -0,0 +1,21 @@ +class Solution(object): + def topKFrequent(self, nums, k): + """ + :type nums: List[int] + :type k: int + :rtype: List[int] + """ + freq = {} + for n in nums: + freq[n] = freq.get(n, 0) + 1 + + buckets = [[] for _ in range(len(nums) + 1)] + for num, count in freq.items(): + buckets[count].append(num) + + result = [] + for count in range(len(nums), 0, -1): + for num in buckets[count]: + result.append(num) + if len(result) == k: + return result From eef2a8ad674a1a8a601293b27e2cdb3b905409c8 Mon Sep 17 00:00:00 2001 From: Junhyeong Park Date: Sat, 15 Nov 2025 20:05:30 +0900 Subject: [PATCH 4/4] feat: solution --- contains-duplicate/jun-brro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contains-duplicate/jun-brro.py b/contains-duplicate/jun-brro.py index 0965181e4..c71a13f44 100644 --- a/contains-duplicate/jun-brro.py +++ b/contains-duplicate/jun-brro.py @@ -1,3 +1,3 @@ class Solution(object): def containsDuplicate(self, nums): - return len(set(nums))!=len(nums) \ No newline at end of file + return len(set(nums))!=len(nums)