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

const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; rl.on("line", (line) => { input.push(line); }).on("close", () => { const num = Number(input.splice(0, 1)) + 1; const expression = input[0].split(" "); const numbers = new Array(10).fill(0).map((el, i) => i); const visited = new Array(10).fill(false); con..

// 백준 14888번 연산자 끼워넣기를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const permutations = function* (elements) { if (elements.length === 1) { yield elements; } else { const [first, ...rest] = elements; for (const a of permutations(rest)) { for (let i = 0; i < elements.length; i++) { const start = a.slice(0, i)..

// 백준 6603번 로또를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const combinations = function* (elements, selectNumber) { for (let i = 0; i < elements.length; i++) { if (selectNumber === 1) { yield [elements[i]]; } else { const fixed = elements[i]; const rest = combinations(elements.slice(i + 1), selectNumber - ..

코드 중간 주석 부분을 확인할 것 // 백준 10971번 외판원 순회2를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; const permutations = function* (elements) { if (elements.length === 1) { yield elements; } else { const [first, ...rest] = elements; for (const a of permutations(rest)) { for (let i = 0; i < elements.length..

const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); let count; const input = []; let maxValue = -987654321; rl.on("line", (line) => { if (!count) { count = Number(line); } else { input.push(line); if (input.length === count) { main(); } } }); const getPermutations = function* (elements) { if (elements.length === 1) { yield..