일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 크롤링
- dp
- TCP
- HTTP
- 타입 챌린지
- 프로그래머스
- HTTP 완벽 가이드
- 프로그래머스 레벨 2
- Algorithm
- typescript
- 그래프
- 알고리즘
- 쉬운 문제
- 자바스크립트
- ip
- 타입스크립트
- Node.js
- 문자열
- 백준
- BFS
- 수학
- dfs
- type challenge
- Crawling
- 소켓
- 레벨 1
- socket
- Nestjs
- javascript
- 가천대
- Today
- Total
목록프로그래머스 레벨2 (2)
kakasoo
// 프로그래머스 레벨2 튜플을 풀었습니다. const solution = (s) => { // "{{4,2,3},{3},{2,3,4,1},{2,3}}" const arr = s .split("},") .map((str) => { // [ '4,2,3', '3', '2,3,4,1', '2,3' ] return str .split("") .filter((el) => el !== "{" && el !== "}") .join(""); }) .sort((a, b) => { // [ '3', '2,3', '4,2,3', '2,3,4,1' ] return a.length - b.length; }) .m..
// 프로그래머스 레벨2 땅따먹기를 풀었습니다. // DP인 것은 알았지만, 코드로 구현하는 데에 상당히 오래 걸렸습니다. const solution = (land) => { const DP = new Array(land.length).fill(0); for (let i = 0; i < land.length; i++) { DP[i] = []; } for (let i = 0; i < land[0].length; i++) { DP[0][i] = land[0][i]; } for (let i = 1; i < land.length; i++) { DP[i][0] = land[i][0] + Math.max(DP[i - 1][1], DP[i - 1][2], DP[i - 1][3]); DP[i][1] = land[i][..