Skip to content

Commit affc837

Browse files
authored
Revert "[정기적 해설 추가] 2022-03-23, 2문제"
1 parent fdea946 commit affc837

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

level-2/땅따먹기.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,4 @@ function solution(land) {
1616
/* 풀이 과정
1717
1. land의 행만큼 반복문을 돌린다.
1818
2. i행(두번째 행)부터 land.length - 1행(마지막 행)까지 본인 열을 제외한 나머지 열의 최댓값을 본인의 열에 더하여 누적한다.
19-
3. 마지막까지 다 구하면 마지막 행에서 최대값을 반환한다.*/
20-
21-
//정답 2 - codeisneverodd
22-
function solution(land) {
23-
for (let rowIndex = 1; rowIndex < land.length; rowIndex++) {
24-
for (let colIndex = 0; colIndex < land[0].length; colIndex++) {
25-
land[rowIndex][colIndex] += Math.max(...land[rowIndex - 1].slice(0, colIndex), ...land[rowIndex - 1].slice(colIndex + 1))
26-
}
27-
}
28-
return Math.max(...land[land.length - 1])
29-
}
19+
3. 마지막까지 다 구하면 마지막 행에서 최대값을 반환한다.*/

level-2/예상-대진표.js

-15
This file was deleted.

0 commit comments

Comments
 (0)