aboutsummaryrefslogtreecommitdiff
path: root/other/max_area_island.cpp
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-06-27 12:23:02 -0600
committerJack Sangdahl <[email protected]>2025-06-27 12:23:02 -0600
commita96b65cbfad7f62f3db6b2eab105e4e25c0414c5 (patch)
treee2a2b3f49f9fb741be81415266ac93e74cff42ec /other/max_area_island.cpp
parent694ad5ed71edcb1deccab54b72d706b779918276 (diff)
downloadleetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.tar.gz
leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.zip
chore: remove old cpp and rust solutions
Diffstat (limited to 'other/max_area_island.cpp')
-rw-r--r--other/max_area_island.cpp24
1 files changed, 0 insertions, 24 deletions
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<vector<int>> &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<vector<int>> &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);
- }
-};