일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Python
- Lv. 2
- Lv. 0
- Lv. 1
- dfs
- 너비 우선 탐색
- SQL 고득점 KIT
- 깊이 우선 탐색
- Stack
- 문자열
- softeer
- bfs
- 자바스크립트
- 프로그래머스
- group by
- 브루트포스
- DP
- Lv. 3
- 다이나믹프로그래밍
- level3
- Java
- level 3
- 소프티어
- 메모이제이션
- 파이썬
- javascript
- programmers
- Dynamic Programming
- 스택
- C언어
- Today
- Total
목록자바스크립트 (106)
몸과 마음이 건전한 SW 개발자
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/42840 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(answers) { const one = Array(10000).fill(1).map((e, idx) => (e + idx) % 5 ? (e + idx) % 5 : 5) const assistTwo = [2, 1, 2, 3, 2, 4, 2, 5] const two = Array(10000).fill().map((e, idx) => assistT..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/42747 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(citations) { let answer = 0; const totalCnts = citations.length; const sortCitations = citations.sort((a, b) => b - a); for (let idx = 0; idx < totalCnts; idx++) { if (idx < citations[idx]) { a..
sort() : 사전순 const tc1 = [1, 5, 10, 3, 11] const tc2 = ["D", "A", "b", "z", "a"] const tc3 = [2, 10, 1, "A", "b"] const tc4 = ["AB", "A", "BC", "B", "AAAAA"] console.log(tc1.sort()) // [ 1, 10, 11, 3, 5 ] console.log(tc2.sort()) // [ 'A', 'D', 'a', 'b', 'z' ] console.log(tc3.sort()) // [ 1, 10, 2, 'A', 'b' ] console.log(tc4.sort()) // [ 'A', 'AAAAA', 'AB', 'B', 'BC' ] sort((a, b) => a - b) : 오름차..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/42748 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(array, commands) { const answer = commands.map(([i, j, k]) => { return array.slice(i-1, j).sort((a, b) => a - b)[k-1] }) return answer; }
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/42578 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(clothes) { const clothesDict = {} clothes.forEach(([clothesName, clothesType]) => { if (clothesDict[clothesType] !== undefined) { clothesDict[clothesType].push(clothesName) } else { clothesDict..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/181896 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 1 function solution(num_list) { const answer = num_list.indexOf(num_list.find((e) => 0 > e)); return answer; } 정답 코드 2 function solution(num_list) { const answer = num_list.findIndex((e) => 0 > e); return answe..