From 4a9f95db464d00f5828df3744b0b14310b0a7c7f Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Sun, 21 Jun 2026 20:54:32 +0900 Subject: [PATCH 01/14] feat: contains-duplicate solution --- contains-duplicate/Yiseull.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 contains-duplicate/Yiseull.py diff --git a/contains-duplicate/Yiseull.py b/contains-duplicate/Yiseull.py new file mode 100644 index 0000000000..0648d87c56 --- /dev/null +++ b/contains-duplicate/Yiseull.py @@ -0,0 +1,3 @@ +class Solution: + def containsDuplicate(self, nums: List[int]) -> bool: + return len(nums) != len(set(nums)) From f173778c4788eee02b6040f0a6b70309d137faa7 Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Sun, 21 Jun 2026 21:09:33 +0900 Subject: [PATCH 02/14] feat: two-sum solution --- two-sum/Yiseull.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 two-sum/Yiseull.py diff --git a/two-sum/Yiseull.py b/two-sum/Yiseull.py new file mode 100644 index 0000000000..2ed5bde4f5 --- /dev/null +++ b/two-sum/Yiseull.py @@ -0,0 +1,7 @@ +class Solution: + def twoSum(self, nums: List[int], target: int) -> List[int]: + numMap = {} + for i, num in enumerate(nums): + if target - num in numMap: + return [numMap[target- num], i] + numMap[num] = i From 23487fb8b64ce157f0ac6bef34ae9b446a378fb7 Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Sun, 21 Jun 2026 21:19:33 +0900 Subject: [PATCH 03/14] feat: 347. Top K Frequent Elements solution --- top-k-frequent-elements/Yiseull.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 top-k-frequent-elements/Yiseull.py diff --git a/top-k-frequent-elements/Yiseull.py b/top-k-frequent-elements/Yiseull.py new file mode 100644 index 0000000000..5568fc4021 --- /dev/null +++ b/top-k-frequent-elements/Yiseull.py @@ -0,0 +1,5 @@ +from collections import Counter + +class Solution: + def topKFrequent(self, nums: List[int], k: int) -> List[int]: + return [key for key, counter in Counter(nums).most_common(k)] From 82f452124c64ee63baf9eab1aedde12e903700d1 Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Sun, 21 Jun 2026 21:37:09 +0900 Subject: [PATCH 04/14] feat: 347. Top K Frequent Elements solution --- top-k-frequent-elements/Yiseull.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/top-k-frequent-elements/Yiseull.py b/top-k-frequent-elements/Yiseull.py index 5568fc4021..8ca57672c6 100644 --- a/top-k-frequent-elements/Yiseull.py +++ b/top-k-frequent-elements/Yiseull.py @@ -2,4 +2,13 @@ class Solution: def topKFrequent(self, nums: List[int], k: int) -> List[int]: - return [key for key, counter in Counter(nums).most_common(k)] + # return [key for key, counter in Counter(nums).most_common(k)] + + counter = {} + for num in nums: + if num in counter: + counter[num] += 1 + continue + counter[num] = 1 + + return [key for key, counter in sorted(counter.items(), key=lambda x: -x[1])[0:k]] From 1659154d3d8143b16505e9c2051fed22662bc87c Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Tue, 23 Jun 2026 21:02:30 +0900 Subject: [PATCH 05/14] feat: 128. Longest Consecutive Sequence solution --- longest-consecutive-sequence/Yiseull.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 longest-consecutive-sequence/Yiseull.py diff --git a/longest-consecutive-sequence/Yiseull.py b/longest-consecutive-sequence/Yiseull.py new file mode 100644 index 0000000000..6b109e7f2f --- /dev/null +++ b/longest-consecutive-sequence/Yiseull.py @@ -0,0 +1,16 @@ +class Solution: + def longestConsecutive(self, nums: List[int]) -> int: + answer = 0 + numsSet = set(nums) + for num in numsSet: + if num - 1 in numsSet: + continue + + size = 1 + while num + 1 in numsSet: + size += 1 + num += 1 + + answer = max(answer, size) + + return answer From 9f3f0b1d6dd07d91b540cc5749035923278b8aad Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Thu, 25 Jun 2026 22:19:47 +0900 Subject: [PATCH 06/14] feat: 347. Top K Frequent Elements solution --- top-k-frequent-elements/Yiseull.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/top-k-frequent-elements/Yiseull.py b/top-k-frequent-elements/Yiseull.py index 8ca57672c6..ad7d72050f 100644 --- a/top-k-frequent-elements/Yiseull.py +++ b/top-k-frequent-elements/Yiseull.py @@ -4,6 +4,15 @@ class Solution: def topKFrequent(self, nums: List[int], k: int) -> List[int]: # return [key for key, counter in Counter(nums).most_common(k)] + # counter = {} + # for num in nums: + # if num in counter: + # counter[num] += 1 + # continue + # counter[num] = 1 + # + # return [key for key, counter in sorted(counter.items(), key=lambda x: -x[1])[0:k]] + counter = {} for num in nums: if num in counter: @@ -11,4 +20,11 @@ def topKFrequent(self, nums: List[int], k: int) -> List[int]: continue counter[num] = 1 - return [key for key, counter in sorted(counter.items(), key=lambda x: -x[1])[0:k]] + heap = [(-v, k) for k, v in counter.items()] + heapify(heap) + + answer = [] + for _ in range(k): + answer.append(heappop(heap)[1]) + + return answer \ No newline at end of file From f87bd6db2c6b34212581e9dc7a0628be3c16f4d8 Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Sun, 28 Jun 2026 00:16:40 +0900 Subject: [PATCH 07/14] =?UTF-8?q?fix:=20=EC=A4=84=EB=B0=94=EA=BF=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- top-k-frequent-elements/Yiseull.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/top-k-frequent-elements/Yiseull.py b/top-k-frequent-elements/Yiseull.py index ad7d72050f..3d713a4ce3 100644 --- a/top-k-frequent-elements/Yiseull.py +++ b/top-k-frequent-elements/Yiseull.py @@ -27,4 +27,4 @@ def topKFrequent(self, nums: List[int], k: int) -> List[int]: for _ in range(k): answer.append(heappop(heap)[1]) - return answer \ No newline at end of file + return answer From cb9db2b75a1468731aa7d01e4f12664d7bcf3a3e Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Sun, 28 Jun 2026 23:49:15 +0900 Subject: [PATCH 08/14] feat: 242. Valid Anagram solution --- valid-anagram/Yiseull.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 valid-anagram/Yiseull.py diff --git a/valid-anagram/Yiseull.py b/valid-anagram/Yiseull.py new file mode 100644 index 0000000000..b755e03fb8 --- /dev/null +++ b/valid-anagram/Yiseull.py @@ -0,0 +1,5 @@ +from collections import Counter + +class Solution: + def isAnagram(self, s: str, t: str) -> bool: + return Counter(s) == Counter(t) From 4f952d7c8e28927e20d7d674751febce2137875f Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Mon, 29 Jun 2026 19:37:57 +0900 Subject: [PATCH 09/14] feat: 70. Climbing Stairs solution --- climbing-stairs/Yiseull.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 climbing-stairs/Yiseull.py diff --git a/climbing-stairs/Yiseull.py b/climbing-stairs/Yiseull.py new file mode 100644 index 0000000000..ae3e98cee2 --- /dev/null +++ b/climbing-stairs/Yiseull.py @@ -0,0 +1,11 @@ +class Solution: + def climbStairs(self, n: int) -> int: + if n == 1: return 1 + + dp = [0 for _ in range(n + 1)] + dp[0], dp[1] = 1, 1 + + for i in range(2, n + 1): + dp[i] = dp[i - 1] + dp[i - 2] + + return dp[n] From 351c777d4cda1bb91668f7dd1e619734df9125b3 Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Fri, 3 Jul 2026 16:42:46 +0900 Subject: [PATCH 10/14] feat: 238. Product of Array Except Self solution --- product-of-array-except-self/Yiseull.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 product-of-array-except-self/Yiseull.py diff --git a/product-of-array-except-self/Yiseull.py b/product-of-array-except-self/Yiseull.py new file mode 100644 index 0000000000..b30a955c49 --- /dev/null +++ b/product-of-array-except-self/Yiseull.py @@ -0,0 +1,15 @@ +class Solution: + def productExceptSelf(self, nums: List[int]) -> List[int]: + n = len(nums) + answer = [1] + + # answer[i] -> nums[i] 왼쪽 값들의 곱 + for i in range(1, n): + answer.append(answer[i - 1] * nums[i - 1]) + + tmp = 1 + for i in range(n - 1, -1, -1): + answer[i] *= tmp + tmp *= nums[i] + + return answer From 6bafe9bfebd1c9a01fb928ce8df416b3ef8b1a75 Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Sat, 4 Jul 2026 01:18:23 +0900 Subject: [PATCH 11/14] feat: 15. 3Sum solution --- 3sum/Yiseull.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 3sum/Yiseull.py diff --git a/3sum/Yiseull.py b/3sum/Yiseull.py new file mode 100644 index 0000000000..340b0a09e2 --- /dev/null +++ b/3sum/Yiseull.py @@ -0,0 +1,27 @@ +class Solution: + def threeSum(self, nums: list[int]) -> list[list[int]]: + answer = set() + + nums = sorted(nums) + + n = len(nums) + for i in range(n - 2): + if nums[i] > 0: + break + + if i > 0 and nums[i] == nums[i - 1]: + continue + + left, right = i + 1, n - 1 + while left < right: + threeSum = nums[i] + nums[left] + nums[right] + if threeSum < 0: + left += 1 + elif threeSum == 0: + answer.add((nums[i], nums[left], nums[right])) + left += 1 + right -= 1 + else: + right -= 1 + + return list(answer) From 6c17af853596fef915d3d02fbb79d7183f156f06 Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Sat, 4 Jul 2026 22:51:14 +0900 Subject: [PATCH 12/14] feat: 98. Validate Binary Search Tree solution --- validate-binary-search-tree/Yiseull.java | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 validate-binary-search-tree/Yiseull.java diff --git a/validate-binary-search-tree/Yiseull.java b/validate-binary-search-tree/Yiseull.java new file mode 100644 index 0000000000..40a4ce4be1 --- /dev/null +++ b/validate-binary-search-tree/Yiseull.java @@ -0,0 +1,27 @@ +/** + * Definition for a binary tree node. + * public class TreeNode { + * int val; + * TreeNode left; + * TreeNode right; + * TreeNode() {} + * TreeNode(int val) { this.val = val; } + * TreeNode(int val, TreeNode left, TreeNode right) { + * this.val = val; + * this.left = left; + * this.right = right; + * } + * } + */ +class Solution { + public boolean isValidBST(TreeNode root) { + return validate(root, null, null); + } + + private boolean validate(TreeNode node, Integer low, Integer high) { + if (node == null) return true; + if (low != null && low >= node.val) return false; + if (high != null && high <= node.val) return false; + return validate(node.left, low, node.val) && validate(node.right, node.val, high); + } +} From db3afb5c6047b4f59e97337d6d414864f43aef06 Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Sat, 4 Jul 2026 23:17:48 +0900 Subject: [PATCH 13/14] feat: 70. Climbing Stairs solution2 --- climbing-stairs/Yiseull.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/climbing-stairs/Yiseull.py b/climbing-stairs/Yiseull.py index ae3e98cee2..c124f1f6d8 100644 --- a/climbing-stairs/Yiseull.py +++ b/climbing-stairs/Yiseull.py @@ -1,11 +1,9 @@ class Solution: def climbStairs(self, n: int) -> int: - if n == 1: return 1 + if n <= 2: return n - dp = [0 for _ in range(n + 1)] - dp[0], dp[1] = 1, 1 + p, q = 1, 2 + for i in range(3, n + 1): + p, q = q, p + q - for i in range(2, n + 1): - dp[i] = dp[i - 1] + dp[i - 2] - - return dp[n] + return q From ee7675532d93b6564ffeec2b2fa6b63a7944eabb Mon Sep 17 00:00:00 2001 From: Yiseul Park Date: Sat, 4 Jul 2026 23:21:45 +0900 Subject: [PATCH 14/14] =?UTF-8?q?fix:=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- product-of-array-except-self/Yiseull.py | 2 +- valid-anagram/Yiseull.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/product-of-array-except-self/Yiseull.py b/product-of-array-except-self/Yiseull.py index b30a955c49..d700e99bb8 100644 --- a/product-of-array-except-self/Yiseull.py +++ b/product-of-array-except-self/Yiseull.py @@ -8,7 +8,7 @@ def productExceptSelf(self, nums: List[int]) -> List[int]: answer.append(answer[i - 1] * nums[i - 1]) tmp = 1 - for i in range(n - 1, -1, -1): + for i in reversed(range(n)): answer[i] *= tmp tmp *= nums[i] diff --git a/valid-anagram/Yiseull.py b/valid-anagram/Yiseull.py index b755e03fb8..2e84c297f7 100644 --- a/valid-anagram/Yiseull.py +++ b/valid-anagram/Yiseull.py @@ -2,4 +2,7 @@ class Solution: def isAnagram(self, s: str, t: str) -> bool: + if len(s) != len(t): + return False + return Counter(s) == Counter(t)