728x90
나의 풀이
def solution(land):
for step in range(1, len(land)):
for i in range(4):
land[step][i] += max(land[step - 1][i - 1], land[step - 1][i - 2], land[step - 1][i - 3])
return max(land[-1])
반응형
'Coding Test > Programmers' 카테고리의 다른 글
[프로그래머스/파이썬] k진수에서 소수 개수 구하기 (0) | 2022.06.20 |
---|---|
[프로그래머스/파이썬] 멀리 뛰기 (0) | 2022.06.20 |
[프로그래머스/파이썬] 다음 큰 숫자 (0) | 2022.06.20 |
[프로그래머스/파이썬] [3차] n진수 게임 (0) | 2022.06.20 |
[프로그래머스/파이썬] 올바른 괄호 (0) | 2022.06.20 |