반응형
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
- 문자열
- 쉬운 문제
- 수학
- javascript
- TCP
- type challenge
- 프로그래머스 레벨 2
- Nestjs
- HTTP
- 프로그래머스
- 타입스크립트
- ip
- dfs
- 크롤링
- 소켓
- 타입 챌린지
- HTTP 완벽 가이드
- 백준
- Crawling
- 자바스크립트
- 알고리즘
- dp
- 가천대
- Algorithm
- 그래프
- 레벨 1
- socket
- BFS
- Node.js
- typescript
Archives
- Today
- Total
kakasoo
[node.js] 같은 수는 싫어 ( 프로그래머스 레벨1 ) 본문
반응형
// 프로그래머스 level1 같은 수는 싫어
function solution(arr) {
let answer = [];
arr.map((el, i) => {
if (arr[i] !== arr[i-1]) {
answer.push(el);
}
})
return answer;
}
반응형
'프로그래밍 > 알고리즘 풀이' 카테고리의 다른 글
[node.js] 두 정수 사이의 합 ( 프로그래머스 레벨1 ) (0) | 2021.06.25 |
---|---|
[node.js] 나누어 떨어지는 수 ( 프로그래머스 레벨1 ) (0) | 2021.06.25 |
[node.js] 가운데 글자 가져오기 ( 프로그래머스 레벨1 ) (0) | 2021.06.25 |
[node.js] 2016년 ( 프로그래머스 레벨1 ) (0) | 2021.06.25 |
[node.js] 체육복 ( 프로그래머스 레벨1 ) (0) | 2021.06.25 |