From f423e886ff72d7bd79a405b3c02ebb5a72048eda Mon Sep 17 00:00:00 2001 From: daiyongg-kim <134879427+daiyongg-kim@users.noreply.github.com> Date: Sun, 14 Dec 2025 17:29:24 -0800 Subject: [PATCH 1/3] adding valid parentheses --- valid-parentheses/daiyongg-kim.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 valid-parentheses/daiyongg-kim.py diff --git a/valid-parentheses/daiyongg-kim.py b/valid-parentheses/daiyongg-kim.py new file mode 100644 index 000000000..22de1f080 --- /dev/null +++ b/valid-parentheses/daiyongg-kim.py @@ -0,0 +1,22 @@ +class Solution: + def isValid(self, s: str) -> bool: + stack = [] + + for c in s: + if c == '(' or c == '[' or c == '{': + stack.append(c) + else: + if not stack: + return False + + cur = stack.pop() + if cur == '(' and c != ')': + return False + if cur == '{' and c != '}': + return False + if cur == '[' and c != ']': + return False + if not stack: + return True + else: + return False \ No newline at end of file From ebd138409d311e8c6b540dc8c96d3f34a745138d Mon Sep 17 00:00:00 2001 From: daiyongg-kim <134879427+daiyongg-kim@users.noreply.github.com> Date: Sun, 14 Dec 2025 17:34:15 -0800 Subject: [PATCH 2/3] update inline --- valid-parentheses/daiyongg-kim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/valid-parentheses/daiyongg-kim.py b/valid-parentheses/daiyongg-kim.py index 22de1f080..f5bf821b7 100644 --- a/valid-parentheses/daiyongg-kim.py +++ b/valid-parentheses/daiyongg-kim.py @@ -19,4 +19,4 @@ def isValid(self, s: str) -> bool: if not stack: return True else: - return False \ No newline at end of file + return False From 80d8807a7da4e9dab1675db460c906a2dcecd3d3 Mon Sep 17 00:00:00 2001 From: daiyongg-kim <134879427+daiyongg-kim@users.noreply.github.com> Date: Fri, 19 Dec 2025 16:37:40 -0800 Subject: [PATCH 3/3] adding container with most water --- container-with-most-water/daiyongg-kim.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 container-with-most-water/daiyongg-kim.py diff --git a/container-with-most-water/daiyongg-kim.py b/container-with-most-water/daiyongg-kim.py new file mode 100644 index 000000000..92330faf3 --- /dev/null +++ b/container-with-most-water/daiyongg-kim.py @@ -0,0 +1,12 @@ +class Solution: + def maxArea(self, height: List[int]) -> int: + left = 0 + right = len(height) - 1 + max_area = 0 + while left < right: + max_area = max(max_area, min(height[left], height[right]) * (right - left)) + if height[left] < height[right]: + left += 1 + else: + right -= 1 + return max_area