From 4282305f7f657f493ba0c373f19ee20d65c2aeb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8C=80=ED=98=84=20=28Kim=20DaeHyun=29?= Date: Tue, 30 Jun 2026 00:29:45 +0900 Subject: [PATCH 1/3] Solve Valid-Anagram --- valid-anagram/daehyun99.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 valid-anagram/daehyun99.py diff --git a/valid-anagram/daehyun99.py b/valid-anagram/daehyun99.py new file mode 100644 index 0000000000..bfcc871ed1 --- /dev/null +++ b/valid-anagram/daehyun99.py @@ -0,0 +1,16 @@ +from collections import defaultdict +class Solution: + def isAnagram(self, s: str, t: str) -> bool: + count = defaultdict(int) + + if len(s) != len(t): + return False + + for s_, t_ in zip(s, t): + count[s_] += 1 + count[t_] -= 1 + + for key, val in count.items(): + if val != 0: + return False + return True From d678b085b78428a2ec74d1dfd863ad1937f07eb1 Mon Sep 17 00:00:00 2001 From: daehyun99 Date: Tue, 30 Jun 2026 17:31:33 +0900 Subject: [PATCH 2/3] Solve: Climbing Stairs --- climbing-stairs/daehyun99.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 climbing-stairs/daehyun99.py diff --git a/climbing-stairs/daehyun99.py b/climbing-stairs/daehyun99.py new file mode 100644 index 0000000000..09681c6150 --- /dev/null +++ b/climbing-stairs/daehyun99.py @@ -0,0 +1,20 @@ +class Solution: + def climbStairs(self, n: int) -> int: + one_count = n + two_count = 0 + total_count = 0 + + while one_count >=0 and two_count >=0: + # 조합 + total = one_count + two_count + + count = 1 + for i in range(two_count): + count *= total - i + for i in range(two_count, 0, -1): + count /= i + total_count += count + + one_count -=2 + two_count +=1 + return int(total_count) From 15f3895a75ebbf479100404de57168a053d04c8e Mon Sep 17 00:00:00 2001 From: daehyun99 Date: Wed, 1 Jul 2026 18:59:24 +0900 Subject: [PATCH 3/3] Solve: Product of Array except self --- product-of-array-except-self/daehyun99.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 product-of-array-except-self/daehyun99.py diff --git a/product-of-array-except-self/daehyun99.py b/product-of-array-except-self/daehyun99.py new file mode 100644 index 0000000000..26e3fee3e2 --- /dev/null +++ b/product-of-array-except-self/daehyun99.py @@ -0,0 +1,18 @@ +class Solution: + def productExceptSelf(self, nums: List[int]) -> List[int]: + product = 1 + zero_pos = set() + + for i in range(len(nums)): + num = nums[i] + if num != 0: + product *= num + else: + zero_pos.add(i) + + if len(zero_pos) >= 2: + return [0 for num in nums] + elif len(zero_pos) == 1: + return [0 if i not in zero_pos else product for i in range(len(nums))] + else: + return [int(product / num) for num in nums]