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_area_island.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 other/max_area_island.cpp (limited to 'other/max_area_island.cpp') diff --git a/other/max_area_island.cpp b/other/max_area_island.cpp deleted file mode 100644 index aad8b2d..0000000 --- a/other/max_area_island.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int maxAreaOfIsland(vector> &grid) { - int ans = 0; - n = grid.size(), m = grid[0].size(); - for (int i = 0; i < n; i++) - for (int j = 0; j < m; j++) - if (grid[i][j]) - ans = max(ans, helper(i, j, grid)); - return ans; - } - -private: - int n = 0, m = 0; - int helper(int i, int j, vector> &grid) { - if (i < 0 || j < 0 || i >= n || j >= m || !grid[i][j]) - return 0; - grid[i][j] = 0; - return 1 + helper(i - 1, j, grid) + helper(i, j - 1, grid) + - helper(i + 1, j, grid) + helper(i, j + 1, grid); - } -}; -- cgit v1.2.3