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/min_score_path_city.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 other/min_score_path_city.cpp (limited to 'other/min_score_path_city.cpp') diff --git a/other/min_score_path_city.cpp b/other/min_score_path_city.cpp deleted file mode 100644 index 16f4c87..0000000 --- a/other/min_score_path_city.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// 2492. Minimum Score of a Path Between Two Cities -#include "leetcode.h" - -class Solution { -public: - int minScore(int n, vvd & roads) { - unordered_map> graph; - for (auto r : roads) - graph[r[0]][r[1]] = graph[r[1]][r[0]] = r[2]; - unordered_set vis; - function dfs; - dfs = [&](int n) -> int { - int res = INT_MAX; - vis.insert(n); - for (auto [adj, scr] : graph[n]) { - if (!vis.count(adj)) - res = min(res, dfs(adj)); - res = min(res, scr); - } - return res; - }; - return dfs(1); - } -}; - -int main() { - Solution obj; - vvd r1 = {{1, 2, 9}, {2, 3, 6}, {2, 4, 5}, {1, 4, 7}}; - vvd r2 = {{1, 2, 2}, {1, 3, 4}, {3, 4, 7}}; - printf("%d\n", obj.minScore(4, r1)); // expect: 5 - printf("%d\n", obj.minScore(4, r2)); // expect: 2 -} -- cgit v1.2.3