private int minCostUtil(int[][] costs, int house, int prevColor, int k, int[][] dp) {
        if (house == costs.length) {
            return 0;
        }
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < k; i++) {
            if (i == prevColor) {
                continue;
            }
            int val;
            if (dp[house][i] != 0) {
                val = dp[house][i];
            } else {
                val = costs[house][i] + minCostUtil(costs, house + 1, i, k, dp);
                dp[house][i] = val;
            }
            min = Math.min(min, val);
        }
        return min;
    }
Paint House
https://leetcode.com/problems/paint-house/
https://leetcode.com/problems/paint-house-ii/
src/com/interview/dynamic/PaintHouse.java