일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Java
- DP
- bfs
- group by
- SQL 고득점 KIT
- 브루트포스
- dfs
- Lv. 1
- javascript
- 자바스크립트
- level3
- 깊이 우선 탐색
- programmers
- 소프티어
- 메모이제이션
- 너비 우선 탐색
- Python
- Lv. 2
- 파이썬
- Dynamic Programming
- Lv. 3
- 문자열
- C언어
- Lv. 0
- Stack
- softeer
- 다이나믹프로그래밍
- 프로그래머스
- 스택
- level 3
- Today
- Total
목록javascript (102)
몸과 마음이 건전한 SW 개발자
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/42839 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(numbers) { const lenNumbers = numbers.length; const resultArr = new Set(); const dfs = (l, v, str) => { if (l == lenNumbers) { resultArr.add(Number(str.join(""))) return } for (let idx = 0; idx..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/181862 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(myStr) { const answer = myStr.split(/[a b c]/g).filter((e) => e); return answer.length ? answer : ["EMPTY"]; } 풀이 방법 myStr.split(/[a|b|c]/g): 이 부분은 정규 표현식을 사용하여 문자열을 분할한다. 정규 표현식 /[a|b|c]/g는 '..
문제 링크 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; }