일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 그래프
- 문자열
- typescript
- javascript
- HTTP
- 쉬운 문제
- 백준
- Nestjs
- 타입 챌린지
- 프로그래머스
- 수학
- 소켓
- 크롤링
- 레벨 1
- socket
- 가천대
- BFS
- ip
- TCP
- dp
- 타입스크립트
- dfs
- 알고리즘
- Algorithm
- type challenge
- Crawling
- 프로그래머스 레벨 2
- HTTP 완벽 가이드
- Node.js
- 자바스크립트
- Today
- Total
목록프로그래밍 (478)
kakasoo
// 프로그래머스 레벨2 배달을 풀었습니다. const makeMap = (N, road) => { const map = new Array(N).fill(false); for (let i = 0; i value) { map[from - 1][to - 1] = value; map[to - 1][from - 1] = value; } } return map; }; const solution = (N..
// 프로그래머스 레벨2 예상 대진표를 풀었습니다. // 둘 씩 잘라서 계속 붙게 하면 언젠가 만나겠거니, 라는 생각으로 풀었습니다. const getOneRound = (arr) => { const answer = []; for (let i = 0; i { let humans = new Array(n).fill(0); humans[a - 1] = 1; humans[b - 1] = 1; let count = 0; loop1: while (true) { count++; humans = getOneRound(huma..
// 프로그래머스 레벨2 게임 맵 최단 거리를 풀었습니다. const solution = (maps) => { if (!maps[0][0]) { return -1; } const visited = new Array(maps.length); for (let i = 0; i { const queue = [{ y: startY, x: startX }]; visited[startY][startX] = 1; while (q..
// 프로그래머스 레벨 2 [카카오 인턴] 수식 최대화 const getPriority = () => { const operator = ["+", "-", "*"]; const priority = []; let visited; let answer; const dfs = (start) => { visited[start] = true; answer.push(operator[start]); if (answer.length === 3) { priority.push([...answer]); } for (let i = 0; i < operator.length; i++) { if (!visited[i]) { visited[i] = true; dfs(i); visited[i] = false; answer.pop(); ..
// 프로그래머스 레벨1 신규 아이디 추천을 풀었습니다. const firstRule = (str) => str.toLowerCase(); const secondRule = (str) => str .split("") .filter((el) => { const charCode = el.charCodeAt(); const aCode = "a".charCodeAt(); const zCode = "z".charCodeAt(); const zeroCode = "0".charCodeAt(); const nineCode = "9".charCodeAt(); if ( (zeroCode (str.length ? str : "a"); const sixthRule = (str) => { const next = str.leng..
// 프로그래머스 레벨1 로또의 최고 순위와 최저 순위를 풀었습니다. const setRank = (n) => { switch (n) { case 6: return 1; case 5: return 2; case 4: return 3; case 3: return 4; case 2: return 5; case 1: case 0: return 6; } }; const solution = (lottos, win_nums) => { const numbers = lottos.filter((el) => el !== 0); const zeros = lottos.filter((el) => el === 0); let count = 0; numbers.forEach((num) => { if (win_nums.includes..
// 프로그래머스 레벨 1 폰켓몬을 풀었습니다. const solution = (nums) => { const chance = parseInt(nums.length / 2); const max = Array.from(new Set(nums)).length; return max >= chance ? chance : max; };
// 프로그래머스 레벨 1 음양 더하기를 풀었습니다. const solution = (absolutes, signs) => { let sum = 0; for (let i = 0; i < absolutes.length; i++) { sum += signs[i] ? absolutes[i] : -absolutes[i]; } return sum; };
// 프로그래머스 레벨 1 약수의 개수와 덧셈을 풀었습니다. const countDiv = (n) => { const div = new Set(); for (let i = 1; i { let sum = 0; for (let i = left; i
// 프로그래머스 레벨 1 3진법 뒤집기를 풀었습니다. const solution = (n) => parseInt(n.toString(3).split("").reverse().join(""), 3);
// 프로그래머스 level1 예산을 풀었습니다. function solution(d, budget) { d = d.sort((a, b) => a - b); const DP = new Array(d.length).fill(0); if (budget - d[0] >= 0) { DP[0] = 1; budget -= d[0]; } for (let i = 1; i = 0) { DP[i] = Math.max(DP[i - 1] + 1, DP[i]); budget -= d[i]; } } return Math.max(...DP); }
// 프로그래머스 레벨1 소수 만들기를 풀었습니다. const solution = (nums) => { const answer = []; const visited = Array(nums.length).fill(false); let count = 0; const sumOfVisited = () => { let sum = 0; for (let i = 0; i { if (visited.filter((el) => el).length === 3) { answer.push(sumOfVisited()); return;..