265. Paint House II

There are n houses to be painted. Each house can be painted with one of k colors. The cost of painting each house with each color is given in a 2D array costs where costs[i][j] is the cost of painting house i with color j.

No two adjacent houses can have the same color. Find the minimum cost to paint all houses.

Examples
Input: [[16,7]]
Output: 7
Hints

265. Paint House II

There are `n` houses to be painted. Each house can be painted with one of `k` colors. The cost of painting each house with each color is given in a 2D array `costs` where `costs[i][j]` is the cost of painting house `i` with color `j`.