diff --git "a/lkhyun/202510/14 PGM Lv2 \354\247\235\354\247\200\354\226\264 \354\240\234\352\261\260\355\225\230\352\270\260.md" "b/lkhyun/202510/14 PGM Lv2 \354\247\235\354\247\200\354\226\264 \354\240\234\352\261\260\355\225\230\352\270\260.md" new file mode 100644 index 00000000..d204f8e5 --- /dev/null +++ "b/lkhyun/202510/14 PGM Lv2 \354\247\235\354\247\200\354\226\264 \354\240\234\352\261\260\355\225\230\352\270\260.md" @@ -0,0 +1,21 @@ +```java +import java.util.*; +class Solution +{ + public int solution(String s) + { + int answer = -1; + Stack stk = new Stack<>(); + + for(char c : s.toCharArray()){ + if(stk.isEmpty() || stk.peek() != c){ + stk.push(c); + }else{ + stk.pop(); + } + } + + return stk.isEmpty() ? 1 : 0; + } +} +```