일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- Regular Expression
- Class
- Convert Sorted List to Binary Search Tree
- 운영체제
- attribute
- Python
- shiba
- kaggle
- 프로그래머스
- Protocol
- 파이썬
- 109. Convert Sorted List to Binary Search Tree
- DWG
- Decorator
- 315. Count of Smaller Numbers After Self
- concurrency
- 715. Range Module
- 밴픽
- 컴퓨터의 구조
- Python Implementation
- Generator
- 30. Substring with Concatenation of All Words
- Python Code
- iterator
- Substring with Concatenation of All Words
- LeetCode
- data science
- 43. Multiply Strings
- 시바견
- t1
Archives
- Today
- Total
Scribbling
LeetCode: 62. Unique Paths 본문
한국 고등학교 수학 공부했으면 다 푸는 문제
class Solution:
def uniquePaths(self, m: int, n: int) -> int:
board = [[1] * n for _ in range(m)]
for i in range(1, m):
for j in range(1, n):
board[i][j] = board[i-1][j] + board[i][j-1]
return board[m-1][n-1]
'Computer Science > Coding Test' 카테고리의 다른 글
LeetCode: 64. Minimum Path Sum (0) | 2021.09.24 |
---|---|
LeetCode: 63. Unique Paths II (0) | 2021.09.24 |
LeetCode: 61. Rotate List (0) | 2021.09.24 |
LeetCode: 60. Permutation Sequence (0) | 2021.09.24 |
LeetCode: 59. Spiral Matrix II (0) | 2021.09.24 |