From d9dd2d8bdfd6eccf1ce5c096f20ef1ddfdb102eb Mon Sep 17 00:00:00 2001 From: Dale Seo Date: Mon, 17 Nov 2025 14:56:40 -0500 Subject: [PATCH 1/8] ci: remove merge group trigger from integration workflow --- .github/workflows/integration.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index a7cff2614..440ed01a5 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -2,12 +2,10 @@ name: Integration 🔄 on: pull_request: - merge_group: jobs: linelint: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 with: From 7fb126bb901adfb47b3ebeedae553fdedfe4bcce Mon Sep 17 00:00:00 2001 From: Gordon Choi Date: Tue, 18 Nov 2025 14:47:32 +0900 Subject: [PATCH 2/8] valid anagram solution --- valid-anagram/radiantchoi.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 valid-anagram/radiantchoi.py diff --git a/valid-anagram/radiantchoi.py b/valid-anagram/radiantchoi.py new file mode 100644 index 000000000..3cef31c34 --- /dev/null +++ b/valid-anagram/radiantchoi.py @@ -0,0 +1,12 @@ +class Solution: + def isAnagram(self, s: str, t: str) -> bool: + s_letters = {} + t_letters = {} + + for letter in s: + s_letters[letter] = s_letters.get(letter, 0) + 1 + + for letter in t: + t_letters[letter] = t_letters.get(letter, 0) + 1 + + return s_letters == t_letters From b9c6be170e1bea0bb2e507a6f90345ad15652bbf Mon Sep 17 00:00:00 2001 From: Gordon Choi Date: Tue, 18 Nov 2025 14:49:14 +0900 Subject: [PATCH 3/8] product of array except self solution --- product-of-array-except-self/radiantchoi.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 product-of-array-except-self/radiantchoi.py diff --git a/product-of-array-except-self/radiantchoi.py b/product-of-array-except-self/radiantchoi.py new file mode 100644 index 000000000..8d1d29308 --- /dev/null +++ b/product-of-array-except-self/radiantchoi.py @@ -0,0 +1,20 @@ +class Solution: + def productExceptSelf(self, nums: List[int]) -> List[int]: + reduced = 1 + zeroes = 0 + + for num in nums: + if num != 0: + reduced *= num + else: + zeroes += 1 + + result = [] + + for num in nums: + if num == 0: + result.append(0 if zeroes - 1 > 0 else reduced) + else: + result.append(0 if zeroes else reduced // num) + + return result From 4d421e114568a0c1d276bbb615fc5409739cd68c Mon Sep 17 00:00:00 2001 From: Gordon Choi Date: Thu, 20 Nov 2025 21:00:24 +0900 Subject: [PATCH 4/8] 3sum solution --- 3sum/radiantchoi.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 3sum/radiantchoi.py diff --git a/3sum/radiantchoi.py b/3sum/radiantchoi.py new file mode 100644 index 000000000..1b756a09a --- /dev/null +++ b/3sum/radiantchoi.py @@ -0,0 +1,45 @@ +class Solution: + def twoSum(self, target: int, nums: List[int], starting: int) -> List[List[int]]: + left = starting + right = len(nums) - 1 + + result = [] + + while left < right: + if nums[left] + nums[right] == target: + result.append([nums[left], nums[right]]) + left += 1 + right -= 1 + + while left < right and nums[left] == nums[left - 1]: + left += 1 + + while left < right and nums[right] == nums[right + 1]: + right -= 1 + elif nums[left] + nums[right] > target: + right -= 1 + else: + left += 1 + + return result + + def kSum(self, n: int, target: int, nums: List[int], starting: int) -> List[List[int]]: + if n < 2 or starting == len(nums): + return [] + elif n == 2: + return self.twoSum(target, nums, starting) + + result = [] + + for i in range(starting, len(nums) - n + 1): + if i > starting and nums[i] == nums[i - 1]: + continue + + for tail in self.kSum(n - 1, target - nums[i], nums, i + 1): + result.append([nums[i]] + tail) + + return result + + def threeSum(self, nums: List[int]) -> List[List[int]]: + nums.sort() + return self.kSum(3, 0, nums, 0) From 2a3568be023a62ed9987043c3ac0fc4b7cf0eeaf Mon Sep 17 00:00:00 2001 From: Gordon Choi Date: Fri, 21 Nov 2025 14:11:28 +0900 Subject: [PATCH 5/8] fix: sync integration file --- .github/workflows/integration.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 440ed01a5..a7cff2614 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -2,10 +2,12 @@ name: Integration 🔄 on: pull_request: + merge_group: jobs: linelint: runs-on: ubuntu-latest + if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 with: From 69661766cba8e6c70795d8094b1d0fdd652a60e2 Mon Sep 17 00:00:00 2001 From: Gordon Choi Date: Fri, 21 Nov 2025 23:34:47 +0900 Subject: [PATCH 6/8] climbing stairs solution --- climbing-stairs/radiantchoi.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 climbing-stairs/radiantchoi.py diff --git a/climbing-stairs/radiantchoi.py b/climbing-stairs/radiantchoi.py new file mode 100644 index 000000000..260cd0c43 --- /dev/null +++ b/climbing-stairs/radiantchoi.py @@ -0,0 +1,10 @@ +class Solution: + def climbStairs(self, n: int) -> int: + stairs = [1, 1] + + if n > 1: + for i in range(2, n+1): + stairs.append(stairs[i - 1] + stairs[i - 2]) + + return stairs[-1] + \ No newline at end of file From 2d27f84786ff1faaaa22032590f3526d0a543146 Mon Sep 17 00:00:00 2001 From: Gordon Choi Date: Fri, 21 Nov 2025 23:49:27 +0900 Subject: [PATCH 7/8] fix: add additional line for climbing stairs solution --- climbing-stairs/radiantchoi.py | 1 - 1 file changed, 1 deletion(-) diff --git a/climbing-stairs/radiantchoi.py b/climbing-stairs/radiantchoi.py index 260cd0c43..807a51326 100644 --- a/climbing-stairs/radiantchoi.py +++ b/climbing-stairs/radiantchoi.py @@ -7,4 +7,3 @@ def climbStairs(self, n: int) -> int: stairs.append(stairs[i - 1] + stairs[i - 2]) return stairs[-1] - \ No newline at end of file From e7ffca022353f60776fbd27d3312f5033c4f9bab Mon Sep 17 00:00:00 2001 From: Gordon Choi Date: Sat, 22 Nov 2025 22:58:19 +0900 Subject: [PATCH 8/8] validating binary search tree solutions --- validate-binary-search-tree/radiantchoi.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 validate-binary-search-tree/radiantchoi.py diff --git a/validate-binary-search-tree/radiantchoi.py b/validate-binary-search-tree/radiantchoi.py new file mode 100644 index 000000000..9899cce64 --- /dev/null +++ b/validate-binary-search-tree/radiantchoi.py @@ -0,0 +1,21 @@ +# Definition for a binary tree node. +# class TreeNode: +# def __init__(self, val=0, left=None, right=None): +# self.val = val +# self.left = left +# self.right = right +class Solution: + def check(self, root: Optional[TreeNode], minimum: int, maximum: int) -> bool: + if root is None: + return True + + if root.val <= minimum or root.val >= maximum: + return False + + return self.check(root.left, minimum, root.val) and self.check(root.right, root.val, maximum) + + def isValidBST(self, root: Optional[TreeNode]) -> bool: + minimum_constraint = ((-2) ** 31) - 1 + maximum_constraint = 2 ** 31 + + return self.check(root, minimum_constraint, maximum_constraint)