leetcode.com 2026-10-19
🟢2089.find-target-indices-after-sorting-array
🏷️ Tags
#array #binary_search #sorting
🟢2089.find-target-indices-after-sorting-array
🏷️ Tags
#array #binary_search #sorting
Telegraph
find-target-indices-after-sorting-array
You are given a 0-indexed integer array nums and a target element target. A target index is an index i such that nums[i] == target. Return a list of the target indices of nums after sorting nums in non-decreasing order. If there are no target indices, return…
leetcode.cn 2026-10-25
🟡1254.number-of-closed-islands
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
🟡1254.number-of-closed-islands
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
Telegraph
number-of-closed-islands
二维矩阵 grid 由 0 (土地)和 1 (水)组成。岛是由最大的4个方向连通的 0 组成的群,封闭岛是一个 完全 由1包围(左、上、右、下)的岛。 请返回 封闭岛屿 的数目。 示例 1: 输入:grid = [[1,1,1,1,1,1,1,0],[1,0,0,0,0,1,1,0],[1,0,1,0,1,1,1,0],[1,0,0,0,0,1,0,1],[1,1,1,1,1,1,1,0]] 输出:2 解释: 灰色区域的岛屿是封闭岛屿,因为这座岛屿完全被水域包围(即被 1 区域包围)。 示例 2: 输入:grid…
leetcode.com 2026-10-25
🟡1254.number-of-closed-islands
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
🟡1254.number-of-closed-islands
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
Telegraph
number-of-closed-islands
Given a 2D grid consists of 0s (land) and 1s (water). An island is a maximal 4-directionally connected group of 0s and a closed island is an island totally (all left, top, right, bottom) surrounded by 1s. Return the number of closed islands. Example 1:…
leetcode.cn 2026-10-26
🟡3619.count-islands-with-total-value-divisible-by-k
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
🟡3619.count-islands-with-total-value-divisible-by-k
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
Telegraph
count-islands-with-total-value-divisible-by-k
给你一个 m x n 的矩阵 grid 和一个正整数 k。一个 岛屿 是由 正 整数(表示陆地)组成的,并且陆地间 四周 连通(水平或垂直)。 一个岛屿的总价值是该岛屿中所有单元格的值之和。 返回总价值可以被 k 整除 的岛屿数量。 示例 1: 输入: grid = [[0,2,1,0,0],[0,5,0,0,5],[0,0,1,0,0],[0,1,4,7,0],[0,2,0,0,8]], k = 5 输出: 2 解释: 网格中包含四个岛屿。蓝色高亮显示的岛屿的总价值可以被 5 整除,而红色高亮显示的岛屿则不能。…
leetcode.com 2026-10-26
🟡3619.count-islands-with-total-value-divisible-by-k
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
🟡3619.count-islands-with-total-value-divisible-by-k
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
Telegraph
count-islands-with-total-value-divisible-by-k
You are given an m x n matrix grid and a positive integer k. An island is a group of positive integers (representing land) that are 4-directionally connected (horizontally or vertically). The total value of an island is the sum of the values of all cells…