From 80935685f3d1739c8891c8b647acfb3751730efe Mon Sep 17 00:00:00 2001 From: YANG YEEUN Date: Tue, 14 Jul 2026 08:50:47 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=98=AC=EB=B0=94=EB=A5=B8=20=EA=B4=84?= =?UTF-8?q?=ED=98=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- correct_parenthesis.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 correct_parenthesis.java diff --git a/correct_parenthesis.java b/correct_parenthesis.java new file mode 100644 index 0000000..26e9502 --- /dev/null +++ b/correct_parenthesis.java @@ -0,0 +1,18 @@ +import java.util.*; +class Solution { + boolean solution(String s) { + boolean answer = true; + Deque parenthesis = new ArrayDeque<>(); + Map pair = Map.of(')','('); + for(char c : s.toCharArray()){ + if(c=='('){ + parenthesis.push(c); + }else{ + if(parenthesis.isEmpty() || pair.get(c)!=parenthesis.pop()){ + return false; + } + } + } + return parenthesis.isEmpty(); + } +} From c0bc5a16541bbae5d63dc99a6756b806647a3be7 Mon Sep 17 00:00:00 2001 From: YANG YEEUN Date: Tue, 14 Jul 2026 08:55:15 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EC=99=84=EC=A3=BC=ED=95=98=EC=A7=80=20?= =?UTF-8?q?=EB=AA=BB=ED=95=9C=20=EC=84=A0=EC=88=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- no_completion.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 no_completion.java diff --git a/no_completion.java b/no_completion.java new file mode 100644 index 0000000..ce7991c --- /dev/null +++ b/no_completion.java @@ -0,0 +1,14 @@ +import java.util.*; +class Solution { + public String solution(String[] participant, String[] completion) { + Arrays.sort(participant); + Arrays.sort(completion); + int i; + for(i=0; i