반응형
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
- Node.js
- dfs
- Algorithm
- 수학
- 자바스크립트
- HTTP
- type challenge
- Nestjs
- socket
- TCP
- 그래프
- 문자열
- 크롤링
- dp
- HTTP 완벽 가이드
- 프로그래머스
- 레벨 1
- 프로그래머스 레벨 2
- 타입 챌린지
- Crawling
- 백준
- javascript
- 쉬운 문제
- 알고리즘
- 가천대
- BFS
- 타입스크립트
- 소켓
- ip
- typescript
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 |