From 2970119df3978f4d35d23b0374bd4dac1d1d1807 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 2 Dec 2024 16:38:20 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=8A=88=20#404=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=86=94=EB=A3=A8=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\353\245\270_\352\264\204\355\230\270.cpp" | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 "Programmers/\354\230\254\353\260\224\353\245\270_\352\264\204\355\230\270.cpp" diff --git "a/Programmers/\354\230\254\353\260\224\353\245\270_\352\264\204\355\230\270.cpp" "b/Programmers/\354\230\254\353\260\224\353\245\270_\352\264\204\355\230\270.cpp" new file mode 100644 index 0000000..e51ff77 --- /dev/null +++ "b/Programmers/\354\230\254\353\260\224\353\245\270_\352\264\204\355\230\270.cpp" @@ -0,0 +1,23 @@ +#include +#include +#include + +using namespace std; + +bool solution(string s) { + stack st; + + for (char c : s) { + if (c == '(') { + st.push(c); + } else { + if (st.empty()) { + return false; + } + st.pop(); + } + + } + + return st.empty(); +} \ No newline at end of file