From a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Fri, 27 Jun 2025 12:23:02 -0600 Subject: chore: remove old cpp and rust solutions --- other/paint_house3.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 other/paint_house3.cpp (limited to 'other/paint_house3.cpp') diff --git a/other/paint_house3.cpp b/other/paint_house3.cpp deleted file mode 100644 index 1185109..0000000 --- a/other/paint_house3.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int minCost(vector &houses, vector> &cost, int m, int n, - int target) { - int INF = 1000000; - vector>> dp( - m, vector>(target + 1, vector(n, INF))); - for (int i = 1; i <= n; i++) { - if (houses[0] == i) - dp[0][1][i - 1] = 0; - else if (!houses[0]) - dp[0][1][i - 1] = cost[0][i - 1]; - } - for (int i = 1; i < m; i++) { - for (int k = 1; k <= min(target, i + 1); k++) { - for (int j = 1; j <= n; j++) { - if (houses[i] && j != houses[i]) - continue; - int same = dp[i - 1][k][j - 1]; - int diff = INF; - for (int r = 1; r <= n; r++) - if (r != j) - diff = min(diff, dp[i - 1][k - 1][r - 1]); - int paintCost = cost[i][j - 1] * int(!houses[i]); - dp[i][k][j - 1] = min(same, diff) + paintCost; - } - } - } - int ans = *min_element(dp.back().back().begin(), dp.back().back().end()); - return (ans < INF) ? ans : -1; - } -}; -- cgit v1.2.3