ICode9

精准搜索请尝试: 精确搜索
  • LeetCode 1905. Count Sub Islands2022-05-16 07:32:04

    原题链接在这里:https://leetcode.com/problems/count-sub-islands/ 题目: You are given two m x n binary matrices grid1 and grid2 containing only 0's (representing water) and 1's (representing land). An island is a group of 1's connected 4-directionally

  • 2022-1-12DFSday52022-01-23 13:03:19

    题1: 695. 岛屿的最大面积 给你一个大小为 m x n 的二进制矩阵 grid 。 岛屿 是由一些相邻的 1 (代表土地) 构成的组合,这里的「相邻」要求两个 1 必须在 水平或者竖直的四个方向上 相邻。你可以假设 grid 的四个边缘都被 0(代表水)包围着。 岛屿的面积是岛上值为

  • 1905. 统计子岛屿2021-08-22 17:04:00

    遍历grid2,如果在遍历一个岛屿的过程中没有超过相应的grid1的1的范围,说明遍历到了一个子岛屿,否则不是子岛屿 int st[510][510]; int dx[] = {0, 1, 0, -1}; int dy[] = {1, 0, -1, 0}; int valid; class Solution { public: void dfs(int x, int y, int row, int col, vector<

  • 1905. Count Sub Islands2021-07-16 08:01:49

    You are given two m x n binary matrices grid1 and grid2 containing only 0's (representing water) and 1's (representing land). An island is a group of 1's connected 4-directionally (horizontal or vertical). Any cells outside of the grid are

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有