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/max_score_node_sequence.cpp | 43 --------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 other/max_score_node_sequence.cpp (limited to 'other/max_score_node_sequence.cpp') diff --git a/other/max_score_node_sequence.cpp b/other/max_score_node_sequence.cpp deleted file mode 100644 index b4df5d5..0000000 --- a/other/max_score_node_sequence.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int maximumScore(vector &scores, vector> &edges) { - const int n = scores.size(); - vector> adj(n); - for (const vector &edge : edges) { - adj[edge[0]].push_back(edge[1]); - adj[edge[1]].push_back(edge[0]); - } - for (vector &a : adj) { - priority_queue, vector>, greater<>> pqpvg; - for (int v : a) { - int score = scores[v]; - if (pqpvg.size() < 3 || pqpvg.top().first < score) { - pqpvg.push({score, v}); - if (pqpvg.size() > 3) - pqpvg.pop(); - } - } - a.resize(pqpvg.size()); - for (int i = a.size() - 1; i >= 0; --i) { - a[i] = pqpvg.top().second; - pqpvg.pop(); - } - } - int ans = -1; - for (const vector &edge : edges) { - int u = edge[0], v = edge[1], base = scores[u] + scores[v]; - for (int x : adj[u]) { - if (x == v) - continue; - for (int y : adj[v]) { - if (y == u || x == y) - continue; - ans = max(ans, base + scores[x] + scores[y]); - } - } - } - return ans; - } -}; -- cgit v1.2.3