We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fdea946 commit affc837Copy full SHA for affc837
level-2/땅따먹기.js
@@ -16,14 +16,4 @@ function solution(land) {
16
/* 풀이 과정
17
1. land의 행만큼 반복문을 돌린다.
18
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
-}
+3. 마지막까지 다 구하면 마지막 행에서 최대값을 반환한다.*/
level-2/예상-대진표.js
0 commit comments