Skip to content

Commit 29e3703

Browse files
committed
[PGS] 땅따먹기 / Level2 / 30분
1 parent 255a443 commit 29e3703

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def solution(land):
2+
3+
for i in range(1,len(land)):
4+
for j in range(len(land[0])):
5+
# j, 즉 이전 row에서 선택한 열을 제외한 row를 생성
6+
# 한 row의 모든 열에 대해서 똑같은 작업을 진행
7+
row = land[i-1][:j] + land[i-1][j+1:]
8+
land[i][j] += max(row)
9+
10+
return max(land[len(land)-1])

0 commit comments

Comments
 (0)