등굣길 - python(programmers)

참치돌고래·2021년 8월 30일
0

알고리즘

목록 보기
13/36
post-custom-banner

https://programmers.co.kr/learn/courses/30/lessons/42898


def solution(m, n, puddles):
    answer = 0
    
    map = [[0 for x in range(m+1)] for x in range(n+1)]
    
    map[1][1] =1
    
    for i in range(0,n+1):
        for j in range(0,m+1):
            if [j,i] in puddles:
                continue
            if [i,j]== [1,1]:
                continue
            else:
                map[i][j] = map[i-1][j] + map[i][j-1]
                
    answer= map[n][m]
    
            
                
                
    return answer
profile
안녕하세요
post-custom-banner

0개의 댓글