일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- DWG
- Substring with Concatenation of All Words
- 43. Multiply Strings
- Class
- Protocol
- data science
- Generator
- iterator
- 밴픽
- attribute
- 30. Substring with Concatenation of All Words
- Python Implementation
- Convert Sorted List to Binary Search Tree
- kaggle
- t1
- Python Code
- 시바견
- Regular Expression
- Python
- shiba
- 315. Count of Smaller Numbers After Self
- Decorator
- 프로그래머스
- 파이썬
- LeetCode
- 715. Range Module
- 컴퓨터의 구조
- concurrency
- 109. Convert Sorted List to Binary Search Tree
- 운영체제
Archives
- Today
- Total
Scribbling
프로그래머스: 등굣길 본문
def solution(m, n, puddles):
dp = [[0] * m for _ in range(n)]
dp[0][0] = 1
for i in range(1, m):
if [i+1, 1] in puddles:
continue
dp[0][i] = dp[0][i-1]
for i in range(1, n):
if [1, i+1] in puddles:
continue
dp[i][0] = dp[i-1][0]
for i in range(1, n):
for j in range(1, m):
if [j+1, i+1] in puddles:
continue
dp[i][j] = dp[i-1][j] + dp[i][j-1]
return dp[n-1][m-1] % 1000000007
'Computer Science > Coding Test' 카테고리의 다른 글
LeetCode: 109. Convert Sorted List to Binary Search Tree (0) | 2021.10.27 |
---|---|
프로그래머스: 도둑질 (0) | 2021.10.26 |
프로그래머스: 정수 삼각형 (0) | 2021.10.26 |
프로그래머스: N으로 표현 (0) | 2021.10.25 |
LeetCode: 106. Construct Binary Tree from Inorder and Postorder Traversal (0) | 2021.10.21 |