LeetCode刷题: 【695】 岛屿的最大面积(深度优先搜索:递归)

1. 题目 2. 解题思路(DFS) 以迭代中遇到的1为起点向四周进行深度优先搜索,把搜索过的位置置0web 3. 代码 class Solution { public: int maxAreaOfIsland(vector<vector<int>>& grid) { int max_ans = 0; // 在矩阵中按行搜索 1 for(in
相关文章
相关标签/搜索