From 54abc2b2b6afad3c0cd8c6d3e44a0c02ed70fdd9 Mon Sep 17 00:00:00 2001 From: xeonxeonx Date: Mon, 16 Jan 2023 13:53:44 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=A7=9D=EC=A7=80=EC=96=B4=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=ED=95=98=EA=B8=B0=20=EB=AC=B8=EC=A0=9C=20=ED=92=80?= =?UTF-8?q?=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4\240\234\352\261\260\355\225\230\352\270\260.py" | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 "programmers/\354\247\235\354\247\200\354\226\264 \354\240\234\352\261\260\355\225\230\352\270\260.py" diff --git "a/programmers/\354\247\235\354\247\200\354\226\264 \354\240\234\352\261\260\355\225\230\352\270\260.py" "b/programmers/\354\247\235\354\247\200\354\226\264 \354\240\234\352\261\260\355\225\230\352\270\260.py" new file mode 100644 index 0000000..e845974 --- /dev/null +++ "b/programmers/\354\247\235\354\247\200\354\226\264 \354\240\234\352\261\260\355\225\230\352\270\260.py" @@ -0,0 +1,12 @@ +def solution(s): + 리스트 = [] + + for i in s: + if len(리스트) == 0: + 리스트.append(i) + elif i == 리스트[-1]: + 리스트.pop() + else: + 리스트.append(i) + + return int(리스트 == []) \ No newline at end of file From aa9feca98d445b559e982344e4635341af4ce47e Mon Sep 17 00:00:00 2001 From: xeonxeonx Date: Mon, 16 Jan 2023 13:58:27 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EC=A7=9D=EC=A7=80=EC=96=B4=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=ED=95=98=EA=B8=B0=20=EB=AC=B8=EC=A0=9C=20=ED=92=80?= =?UTF-8?q?=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...26\264 \354\240\234\352\261\260\355\225\230\352\270\260.py" | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git "a/programmers/\354\247\235\354\247\200\354\226\264 \354\240\234\352\261\260\355\225\230\352\270\260.py" "b/programmers/\354\247\235\354\247\200\354\226\264 \354\240\234\352\261\260\355\225\230\352\270\260.py" index e845974..6eac0a6 100644 --- "a/programmers/\354\247\235\354\247\200\354\226\264 \354\240\234\352\261\260\355\225\230\352\270\260.py" +++ "b/programmers/\354\247\235\354\247\200\354\226\264 \354\240\234\352\261\260\355\225\230\352\270\260.py" @@ -9,4 +9,5 @@ def solution(s): else: 리스트.append(i) - return int(리스트 == []) \ No newline at end of file + return int(리스트 == []) + \ No newline at end of file