Description:

Solution:


row = [1] * n => The bottom row: [1, 1, 1, 1, 1, 1, 1]
We start from (n-2) with reverse order. When we complete the second row[7, 6, 5, 4, 3, 2, 1], we update this newRow as row.
Time Complexity: O(n*m)
Space Complexity: O(n)
'LeetCode ๐๏ธ > Dynamic Programming' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| 55. Jump Game (0) | 2023.07.06 |
|---|---|
| 91. Decode Ways (0) | 2023.07.04 |
| 213. House Robber II (0) | 2023.07.02 |
| 198. House Robber (0) | 2023.07.01 |
| 377. Combination Sum IV (0) | 2023.06.30 |