House painting minimum cost
Your task
A row of houses must each be painted one of k colors. costs[i][j] is the cost to paint house i with color j. No two adjacent houses may share a color. Return the minimum total cost to paint all houses. costs has at least one color column when non-empty; it may be empty.
Examples
paint_house_k(costs: list[list[int]]) -> intExample 1
Input
paint_house_k([[1, 5, 3], [2, 9, 4]])Output
5