반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- HTTP
- 프로그래머스 레벨 2
- typescript
- 알고리즘
- javascript
- 타입스크립트
- 쉬운 문제
- HTTP 완벽 가이드
- ip
- Node.js
- 수학
- 레벨 1
- 프로그래머스
- 자바스크립트
- Nestjs
- 그래프
- 백준
- TCP
- Crawling
- 타입 챌린지
- Algorithm
- 소켓
- dfs
- dp
- socket
- 가천대
- BFS
- 크롤링
- type challenge
- 문자열
Archives
- Today
- Total
목록땅따먹기 (1)
kakasoo

// 프로그래머스 레벨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][..
프로그래밍/알고리즘 풀이
2021. 7. 1. 14:37