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/path_min_effort1.cpp | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 other/path_min_effort1.cpp (limited to 'other/path_min_effort1.cpp') diff --git a/other/path_min_effort1.cpp b/other/path_min_effort1.cpp deleted file mode 100644 index d9066cd..0000000 --- a/other/path_min_effort1.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "leetcode.h" -#include -#include -#include -#include -#include -#include - -class Solution { - const int d4x[4] = {-1, 0, 1, 0}, d4y[4] = {0, 1, 0, -1}; - -public: - int minimumEffortPath(vector> &heights) { - int n = heights.size(), m = heights[0].size(); - priority_queue, vector>, - greater>> - pq; - vector> dis(n, vector(m, INT_MAX)); - dis[0][0] = 0; - pq.push({0, {0, 0}}); - while (!pq.empty()) { - pair> curr = pq.top(); - pq.pop(); - int d = curr.first, r = curr.second.first, c = curr.second.second; - if (r == n - 1 && c == m - 1) - return d; - for (int i = 0; i < 4; ++i) { - int nX = r + d4x[i], nY = x + d4y[i]; - if (nX < 0 || nX >= n || nY < 0 || nY >= m) - continue; - int nD = max(d, abs(h[nX][nY] - h[r][c])); - if (nD < dis[nX][nY]) { - dis[nX][nY] = nD; - pq.push({nD, {nX, nY}}); - } - } - } - return 0; - } -}; - -int main() {} -- cgit v1.2.3