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/01_matrix.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 other/01_matrix.cpp (limited to 'other/01_matrix.cpp') diff --git a/other/01_matrix.cpp b/other/01_matrix.cpp deleted file mode 100644 index f6d9c2d..0000000 --- a/other/01_matrix.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - vector> updateMatrix(vector> &mat) { - int m = mat.size(), n = mat[0].size(); - vector> ans(m, vector(n, INT_MAX)); - queue> qp; - for (int i = 0; i < m; i++) { - for (int j = 0; j < n; j++) { - if (mat[i][j] == 0) { - ans[i][j] = 0; - qp.push({i, j}); - } - } - } - vector> vp{{0, 1}, {1, 0}, {0, -1}, {-1, 0}}; - while (!qp.empty()) { - auto curr = qp.front(); - qp.pop(); - int currX = curr.first, currY = curr.second; - for (auto dirr : vp) { - int x = currX + dirr.first, y = currY + dirr.second; - if (x >= 0 && x < m && y >= 0 && y < n) { - if (ans[x][y] > ans[currX][currY] + 1) { - ans[x][y] = ans[currX][currY] + 1; - qp.push({x, y}); - } - } - } - } - return ans; - } -}; -- cgit v1.2.3