반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- BFS
- 소켓
- socket
- 알고리즘
- type challenge
- 문자열
- 가천대
- typescript
- 프로그래머스
- dfs
- 자바스크립트
- 수학
- 타입 챌린지
- 백준
- TCP
- javascript
- Nestjs
- 타입스크립트
- ip
- HTTP
- dp
- HTTP 완벽 가이드
- 그래프
- 쉬운 문제
- 레벨 1
- Crawling
- 프로그래머스 레벨 2
- Node.js
- 크롤링
- Algorithm
Archives
- Today
- Total
목록짝지어 제거하기 (1)
kakasoo

// 프로그래머스 레벨2 짝지어 제거하기를 풀었습니다. function solution(s) { let stack = []; for (let i = 0; i < s.length; i++) { if (stack.length !== 0) { if (stack[stack.length - 1] !== s[i]) { stack.push(s[i]); } else { stack.pop(); } } else stack.push(s[i]); } return stack.length === 0 ? 1 : 0; }
프로그래밍/알고리즘 풀이
2021. 6. 29. 13:15