Skip to content

Commit 7ef069c

Browse files
committed
65차 3번 문제풀이
1 parent 719ce1a commit 7ef069c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

live6/test65/문제3/임동민.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function solution(s)
2+
{
3+
const stack = [];
4+
5+
for(let i=0; i<s.length; i++){
6+
if(s[i] === stack[stack.length -1]){
7+
stack.pop();
8+
} else {
9+
stack.push(s[i]);
10+
}
11+
}
12+
13+
return stack.length === 0 ? 1 : 0;
14+
}

0 commit comments

Comments
 (0)