Dynamic Programming

265. Paint House II

265. Paint House II 我是基於 256. Paint House 去將之前的狀態給泛化,不過這樣的時間雜度是

256. Paint House

256. Paint House class Solution: def minCost(self, costs: List[

2244. Minimum Rounds to Complete All Tasks

2244. Minimum Rounds to Complete All Tasks 這一題可以算是經典的 Dynamic Programming

1751. Maximum Number of Events That Can Be Attended II

1751. Maximum Number of Events That Can Be Attended II

931. Minimum Falling Path Sum

931. Minimum Falling Path Sum class Solution: def minFallingPathSum(self,

63. Unique Paths II

63. Unique Paths II class Solution: def uniquePathsWithObstacles(self, obstacleGrid:

2218. Maximum Value of K Coins From Piles

2218. Maximum Value of K Coins From Piles 這一個題目和 188.

276. Paint Fence

276. Paint Fence class Solution: def numWays(self, n: int,

787. Cheapest Flights Within K Stops

787. Cheapest Flights Within K Stops 這一題的考點 1. 在 BFS

1335. Minimum Difficulty of a Job Schedule

1335. Minimum Difficulty of a Job Schedule 這個題目其實寫的滿不清楚的,面試如果遇到這個題目其實也考察如何向面試官搞清楚題目的流程的。 這個題目是給定一個陣列,