Skip to content

Commit 676a453

Browse files
committed
Feat: 배열, 연결 리스트, 스택, 큐_같은 숫자는 싫어(레벨1)
!== 같지 않은 경우로 문제 풀이 가능
1 parent 36baf25 commit 676a453

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function solution(arr) {
2+
const answer = [];
3+
4+
arr.forEach((e) => {
5+
answer.push(e);
6+
if (answer.length > 1 && answer[answer.length - 2] === e) {
7+
answer.pop();
8+
}
9+
});
10+
11+
return answer;
12+
}

0 commit comments

Comments
 (0)