import numpy as np
class Solution(object):
    def mincost(self, houses, costs):
        """
        :type bookings: List[List[int]]
        :type n: int
        :rtype: List[int]
        """
        n = len(houses)
        dp = np.zeros((n+1, 3))
        for i in range(1, n+1):
            dp[i][0] = min(dp[i - 1][1], dp[i - 1][2]) + costs[i][0] # paint red
            dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]) + costs[i][1] # paint green
            dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]) + costs[i][2] # paint blue
        return min(dp[n][0], dp[n][1], dp[n][2])

s1=Solution()
res=s1.mincost([4,2],1)
print(res)

