일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 파이썬
- Lv. 2
- 자바스크립트
- javascript
- Lv. 1
- 동적계획법
- join
- Python
- dfs
- 티스토리챌린지
- bfs
- DP
- 백준
- 깊이 우선 탐색
- group by
- programmers
- SQL 고득점 KIT
- Baekjoon
- LEVEL 2
- Lv. 0
- Lv. 3
- SQL
- Java
- 소프티어
- softeer
- Dynamic Programming
- 오블완
- 프로그래머스
- level 3
- 너비 우선 탐색
- Today
- Total
목록조합 (9)
몸과 마음이 건전한 SW 개발자

문제 링크https://school.programmers.co.kr/learn/courses/30/lessons/388352 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr정답 코드function solution(n, q, ans) { const lenQ = q.length; let answer = 0; for (let i = 1; i 풀이 방법dfs로 만들다가 실패해서 5중 for문으로 만들었다.조합을 만들어서 q의 요소들과 비교한다.ans와 같은 값이 나오면 answer++이후 answer를 출력하면 끝!느낀점사실 dfs를 사용해야 더 깔끔한 풀이가 될 수 있지만 결국 가장 직관적이고..

문제 링크https://school.programmers.co.kr/learn/courses/30/lessons/131702 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr정답 코드function solution(clockHands) { let answer = Infinity; const n = clockHands.length; const isValid = (nr, nc) => 0 { for (let d = 0; d { if (vCnt >= answer) { return; } if (s === n) { ..
문제 링크https://school.programmers.co.kr/learn/courses/30/lessons/214288?language=javascript 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr정답 코드// 멘토 n명, 1~k번 상담 유형, 각 멘토는 k개의 상담 유형 중 하나만 담당function solution(k, n, reqs) { // 단, 각 유형별로 멘토 인원이 적어도 한 명 이상이어야 합니다. let answer = 1000 * 3000; const types = Array.from({length: n+1}, () => []); reqs.forEa..
문제 링크https://school.programmers.co.kr/learn/courses/30/lessons/131703 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr정답 코드function solution(beginning, target) { let minV = 21; const n = beginning.length; const m = beginning[0].length; const selectedRows = []; const selectedCols = []; // 배열이 일치하는지 확인하는 함수 const ..

문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/258709 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(dice) { const n = dice.length; const halfN = n / 2; const m = dice[0].length; const dictD = {}; // n 개 중에서 n // 2개 고르기 const dfs2 = (s, v, dk, tot) => { if (s == halfN) { dictD[dk].push(tot); ..
순열 만드는 방법 1. 방문 배열을 안에 N = 5 def dfs(S, N, V, chosen): if S == N: print(chosen) return for i in range(N): if i not in V: dfs(S+1, N, V+[i], chosen + [i]) 2. 방문 배열을 밖에 N = 5 V = [0 for _ in range(N)] def dfs2(S, chosen): if S == N: print(chosen) return for i in range(N): if V[i]: continue V[i] = 1 dfs2(S+1, chosen+[i]) V[i] = 0 dfs2(0, []) 조합 만드는 방법 L = 5 def dfs(S, wishL, nowL, chosen): if S >= ..