일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- level3
- 너비 우선 탐색
- Lv. 1
- Stack
- dfs
- Lv. 3
- 스택
- programmers
- Python
- C언어
- bfs
- level 3
- DP
- Java
- 소프티어
- SQL 고득점 KIT
- Typescript
- softeer
- Dynamic Programming
- 브루트포스
- group by
- 프로그래머스
- 타입스크립트
- 파이썬
- Lv. 2
- 자바스크립트
- 다이나믹프로그래밍
- javascript
- Lv. 0
- 문자열
- Today
- Total
목록Lv. 1 (22)
몸과 마음이 건전한 SW 개발자
문제 링크 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/42576 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 1 function solution(participant, completion) { let answer = ""; const pDict = {}; for (const p of participant) { const isValid = pDict[p]; if (isValid) { pDict[p] += 1; } else { pDict[p] = 1; }; }; for (const cp..
문제 링크 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/72410 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 function solution(new_id) { // 문자열을 리스트로 만들기 // const arr = Array.from(new_id) // const arr = [...new_id] const arr = new_id.split("") // 1 단계 // e는 element : 요소 const first_step = arr.map((e) => { // toUpperCas..
문제 링크 https://school.programmers.co.kr/tryouts/72053/challenges 정답 코드 def solution(s): answer = '' lenS = len(s) nowIndex = 0 upperLower = True while lenS > nowIndex: alpha = s[nowIndex] nowIndex += 1 if alpha == " ": upperLower = True answer += alpha continue # 대문자부터 if upperLower: answer += alpha.upper() upperLower = False else: answer += alpha.lower() upperLower = True return answer 풀이 방법 - 공..
문제 링크 https://school.programmers.co.kr/tryouts/72052/challenges 정답 코드 def solution(s, n): answer = '' # print(ord("a"), ord("z")) 97 122 # print(ord("A"), ord("Z")) 65 90 for a in s: if a == " ": answer += " " else: if a.isupper(): location = (ord(a) - 65 + n) % 26 + 65 answer += chr(location) else: location = (ord(a) - 97 + n) % 26 + 97 answer += chr(location) return answer 풀이 방법 - ord와 chr 활용 ..