diff --git a/Paint_house.java b/Paint_house.java new file mode 100644 index 00000000..339764f2 --- /dev/null +++ b/Paint_house.java @@ -0,0 +1,30 @@ +// Time Complexity : O(m*k*k) +// Space Complexity : O(m*k) +// Did this code successfully run on Leetcode : yes +class Solution { + public int minCost(int[][] costs) { + int m = costs.length; + int k = costs[0].length; + int[][] dp = new int[m][k]; + for(int i=0; i=0; i--){ + for(int j=0; j