diff options
author | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
commit | a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 (patch) | |
tree | e2a2b3f49f9fb741be81415266ac93e74cff42ec /other/min_score_path_city.cpp | |
parent | 694ad5ed71edcb1deccab54b72d706b779918276 (diff) | |
download | leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.tar.gz leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.zip |
chore: remove old cpp and rust solutions
Diffstat (limited to 'other/min_score_path_city.cpp')
-rw-r--r-- | other/min_score_path_city.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
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<int, unordered_map<int, int>> graph; - for (auto r : roads) - graph[r[0]][r[1]] = graph[r[1]][r[0]] = r[2]; - unordered_set<int> vis; - function<int> 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 -} |