반응형
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
- Algorithm
- Nestjs
- javascript
- 자바스크립트
- 쉬운 문제
- TCP
- Crawling
- 레벨 1
- 프로그래머스 레벨 2
- 그래프
- dfs
- 문자열
- 타입 챌린지
- 프로그래머스
- Node.js
- 크롤링
- HTTP 완벽 가이드
- 알고리즘
- dp
- BFS
- 가천대
- 소켓
- socket
- 수학
- typescript
- HTTP
- 타입스크립트
- ip
- 백준
- type challenge
Archives
- Today
- Total
목록소수 찾기 (1)
kakasoo
[node.js] 소수찾기 ( 프로그래머스 레벨2 )
// 프로그래머스 레벨2 소수찾기를 풀었습니다. let visited = []; let num = []; let res = []; const dfs = (curIdx, curValue = "") => { visited[curIdx] = true; curValue += num[curIdx]; if (!res.includes(curValue)) { res.push(curValue); } for (let i = 0; i < num.length; i++) { if (visited[i] === false) { dfs(i, curValue); visited[i] = false; } } }; function solution(numbers) { num = numbers.split(""); visited = new Ar..
프로그래밍/알고리즘 풀이
2021. 6. 29. 13:08