일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- C언어
- level3
- 문자열
- 프로그래머스
- softeer
- javascript
- Stack
- programmers
- level 3
- 스택
- bfs
- group by
- 소프티어
- Lv. 3
- 깊이 우선 탐색
- 다이나믹프로그래밍
- Lv. 2
- 자바스크립트
- Dynamic Programming
- Python
- 메모이제이션
- Lv. 0
- SQL 고득점 KIT
- DP
- dfs
- Java
- 파이썬
- 너비 우선 탐색
- Lv. 1
- 브루트포스
- Today
- Total
목록javascript (102)
몸과 마음이 건전한 SW 개발자
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/181908 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 1 function solution(my_string, is_suffix) { const lenMyString = my_string.length; const lenIsSuffix = is_suffix.length; if (lenIsSuffix > lenMyString) { return 0 } const diff = lenMyString - lenIsSuffix for (le..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/181913 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(my_string, queries) { const answer = queries.reduce((result, [l, r]) => { result.splice(l, r-l+1, ...(result.slice(l, r+1).reverse())) return result }, Array.from(my_string)).join(""); return ..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/181916 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(a, b, c, d) { const answer = a == b && b == c && c == d ? 1111 * a : a == b && b == c ? (10 * a + d) ** 2 : a == b && b == d ? (10 * a + c) ** 2 : a == c && c == d ? (10 * a + b) ** 2 : b == c..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/86491 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 1 function solution(sizes) { const newSizes = sizes.map(([w, h]) => { if (w >= h) { return [w, h] } return [h, w] }) let maxW = 0 let maxH = 0 newSizes.forEach(([w, h]) => { if (w > maxW) { maxW = w } if (h > ma..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/181919 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(n) { const answer = []; const recursion = (v) => { answer.push(v) if (v == 1) { return } if (v % 2) { recursion(3 * v + 1) } else { recursion(v / 2) } } recursion(n); return answer; } 풀이 방법 재귀..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/181920 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(start_num, end_num) { const arrLength = end_num - start_num + 1 const answer = Array(arrLength).fill(start_num).map((e, idx) => e + idx) return answer; } 배운점 Array, fill, map의 사용법에 대해서 배웠다.