반응형
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 | 29 | 30 |
31 |
Tags
- BFS
- 그래프
- 자바스크립트
- 알고리즘
- javascript
- 백준
- 타입 챌린지
- type challenge
- Algorithm
- 크롤링
- 쉬운 문제
- 프로그래머스
- dp
- 수학
- 타입스크립트
- HTTP 완벽 가이드
- TCP
- Node.js
- 가천대
- dfs
- 프로그래머스 레벨 2
- Nestjs
- socket
- 소켓
- 레벨 1
- 문자열
- Crawling
- ip
- typescript
- HTTP
Archives
- Today
- Total
kakasoo
[node.js] 폰켓몬 ( 프로그래머스 레벨1 ) 본문
반응형
// 프로그래머스 레벨 1 폰켓몬을 풀었습니다.
const solution = (nums) => {
const chance = parseInt(nums.length / 2);
const max = Array.from(new Set(nums)).length;
return max >= chance ? chance : max;
};
반응형
'프로그래밍 > 알고리즘 풀이' 카테고리의 다른 글
[node.js] 신규 아이디 추천 ( 프로그래머스 레벨1 ) (0) | 2021.06.30 |
---|---|
[node.js] 로또의 최고 순위와 최저 순위 ( 프로그래머스 레벨1 ) (0) | 2021.06.30 |
[node.js] 음양 더하기 ( 프로그래머스 레벨1 ) (0) | 2021.06.30 |
[node.js] 약수의 개수와 덧셈 ( 프로그래머스 레벨1 ) (0) | 2021.06.30 |
[node.js] 3진법 뒤집기 ( 프로그래머스 레벨1 ) (0) | 2021.06.30 |