leetcode.cn 2026-03-10
🔴3130.find-all-possible-stable-binary-arrays-ii
🏷️ Tags
#dynamic_programming #prefix_sum
🔴3130.find-all-possible-stable-binary-arrays-ii
🏷️ Tags
#dynamic_programming #prefix_sum
Telegraph
find-all-possible-stable-binary-arrays-ii
给你 3 个正整数 zero ,one 和 limit 。 一个 二进制数组 arr 如果满足以下条件,那么我们称它是 稳定的 :
leetcode.com 2026-03-10
🔴3130.find-all-possible-stable-binary-arrays-ii
🏷️ Tags
#dynamic_programming #prefix_sum
🔴3130.find-all-possible-stable-binary-arrays-ii
🏷️ Tags
#dynamic_programming #prefix_sum
Telegraph
find-all-possible-stable-binary-arrays-ii
You are given 3 positive integers zero, one, and limit. A binary array arr is called stable if:
leetcode.cn 2026-03-16
🟡1878.get-biggest-three-rhombus-sums-in-a-grid
🏷️ Tags
#array #math #matrix #prefix_sum #sorting #heap_priority_queue
🟡1878.get-biggest-three-rhombus-sums-in-a-grid
🏷️ Tags
#array #math #matrix #prefix_sum #sorting #heap_priority_queue
Telegraph
get-biggest-three-rhombus-sums-in-a-grid
给你一个 m x n 的整数矩阵 grid 。 菱形和 指的是 grid 中一个正菱形 边界 上的元素之和。本题中的菱形必须为正方形旋转45度,且四个角都在一个格子当中。下图是四个可行的菱形,每个菱形和应该包含的格子都用了相应颜色标注在图中。 注意,菱形可以是一个面积为 0 的区域,如上图中右下角的紫色菱形所示。 请你按照 降序 返回 grid 中三个最大的 互不相同的菱形和 。如果不同的和少于三个,则将它们全部返回。 示例 1: 输入:grid = [[3,4,5,1,3],[3,3,4,2,3]…
leetcode.com 2026-03-16
🟡1878.get-biggest-three-rhombus-sums-in-a-grid
🏷️ Tags
#array #math #matrix #prefix_sum #sorting #heap_priority_queue
🟡1878.get-biggest-three-rhombus-sums-in-a-grid
🏷️ Tags
#array #math #matrix #prefix_sum #sorting #heap_priority_queue
Telegraph
get-biggest-three-rhombus-sums-in-a-grid
You are given an m x n integer matrix grid. A rhombus sum is the sum of the elements that form the border of a regular rhombus shape in grid. The rhombus must have the shape of a square rotated 45 degrees with each of the corners centered in a grid…
leetcode.cn 2026-03-18
🟡3070.count-submatrices-with-top-left-element-and-sum-less-than-k
🏷️ Tags
#array #matrix #prefix_sum
🟡3070.count-submatrices-with-top-left-element-and-sum-less-than-k
🏷️ Tags
#array #matrix #prefix_sum
Telegraph
count-submatrices-with-top-left-element-and-sum-less-than-k
给你一个下标从 0 开始的整数矩阵 grid 和一个整数 k。 返回包含 grid 左上角元素、元素和小于或等于 k 的 子矩阵的数目。 示例 1: 输入:grid = [[7,6,3],[6,6,1]], k = 18 输出:4 解释:如上图所示,只有 4 个子矩阵满足:包含 grid 的左上角元素,并且元素和小于或等于 18 。 示例 2: 输入:grid = [[7,2,9],[1,5,0],[2,6,6]], k = 20 输出:6 解释:如上图所示,只有 6 个子矩阵满足:包含 grid …
leetcode.com 2026-03-18
🟡3070.count-submatrices-with-top-left-element-and-sum-less-than-k
🏷️ Tags
#array #matrix #prefix_sum
🟡3070.count-submatrices-with-top-left-element-and-sum-less-than-k
🏷️ Tags
#array #matrix #prefix_sum
Telegraph
count-submatrices-with-top-left-element-and-sum-less-than-k
You are given a 0-indexed integer matrix grid and an integer k. Return the number of submatrices that contain the top-left element of the grid, and have a sum less than or equal to k. Example 1: Input: grid = [[7,6,3],[6,6,1]], k = 18 Output: 4 Explanation:…
leetcode.cn 2026-03-19
🟡3212.count-submatrices-with-equal-frequency-of-x-and-y
🏷️ Tags
#array #matrix #prefix_sum
🟡3212.count-submatrices-with-equal-frequency-of-x-and-y
🏷️ Tags
#array #matrix #prefix_sum
Telegraph
count-submatrices-with-equal-frequency-of-x-and-y
给你一个二维字符矩阵 grid,其中 grid[i][j] 可能是 'X'、'Y' 或 '.',返回满足以下条件的子矩阵数量:
leetcode.com 2026-03-19
🟡3212.count-submatrices-with-equal-frequency-of-x-and-y
🏷️ Tags
#array #matrix #prefix_sum
🟡3212.count-submatrices-with-equal-frequency-of-x-and-y
🏷️ Tags
#array #matrix #prefix_sum
Telegraph
count-submatrices-with-equal-frequency-of-x-and-y
Given a 2D character matrix grid, where grid[i][j] is either 'X', 'Y', or '.', return the number of submatrices that contain:
leetcode.cn 2026-03-25
🟡3546.equal-sum-grid-partition-i
🏷️ Tags
#array #enumeration #matrix #prefix_sum
🟡3546.equal-sum-grid-partition-i
🏷️ Tags
#array #enumeration #matrix #prefix_sum
Telegraph
equal-sum-grid-partition-i
给你一个由正整数组成的 m x n 矩阵 grid。你的任务是判断是否可以通过 一条水平或一条垂直分割线 将矩阵分割成两部分,使得:
leetcode.com 2026-03-25
🟡3546.equal-sum-grid-partition-i
🏷️ Tags
#array #enumeration #matrix #prefix_sum
🟡3546.equal-sum-grid-partition-i
🏷️ Tags
#array #enumeration #matrix #prefix_sum
Telegraph
equal-sum-grid-partition-i
You are given an m x n matrix grid of positive integers. Your task is to determine if it is possible to make either one horizontal or one vertical cut on the grid such that:
leetcode.cn 2026-03-26
🔴3548.equal-sum-grid-partition-ii
🏷️ Tags
#array #hash_table #enumeration #matrix #prefix_sum
🔴3548.equal-sum-grid-partition-ii
🏷️ Tags
#array #hash_table #enumeration #matrix #prefix_sum
Telegraph
equal-sum-grid-partition-ii
给你一个由正整数组成的 m x n 矩阵 grid。你的任务是判断是否可以通过 一条水平或一条垂直分割线 将矩阵分割成两部分,使得:
leetcode.com 2026-03-26
🔴3548.equal-sum-grid-partition-ii
🏷️ Tags
#array #hash_table #enumeration #matrix #prefix_sum
🔴3548.equal-sum-grid-partition-ii
🏷️ Tags
#array #hash_table #enumeration #matrix #prefix_sum
Telegraph
equal-sum-grid-partition-ii
You are given an m x n matrix grid of positive integers. Your task is to determine if it is possible to make either one horizontal or one vertical cut on the grid such that:
leetcode.cn 2026-04-29
🔴3225.maximum-score-from-grid-operations
🏷️ Tags
#array #dynamic_programming #matrix #prefix_sum
🔴3225.maximum-score-from-grid-operations
🏷️ Tags
#array #dynamic_programming #matrix #prefix_sum
Telegraph
maximum-score-from-grid-operations
给你一个大小为 n x n 的二维矩阵 grid ,一开始所有格子都是白色的。一次操作中,你可以选择任意下标为 (i, j) 的格子,并将第 j 列中从最上面到第 i 行所有格子改成黑色。 如果格子 (i, j) 为白色,且左边或者右边的格子至少一个格子为黑色,那么我们将 grid[i][j] 加到最后网格图的总分中去。 请你返回执行任意次操作以后,最终网格图的 最大 总分数。 示例 1: 输入:grid = [[0,0,0,0,0],[0,0,3,0,0],[0,1,0,0,0],[5,0,0,3…
leetcode.com 2026-04-29
🔴3225.maximum-score-from-grid-operations
🏷️ Tags
#array #dynamic_programming #matrix #prefix_sum
🔴3225.maximum-score-from-grid-operations
🏷️ Tags
#array #dynamic_programming #matrix #prefix_sum
Telegraph
maximum-score-from-grid-operations
You are given a 2D matrix grid of size n x n. Initially, all cells of the grid are colored white. In one operation, you can select any cell of indices (i, j), and color black all the cells of the jth column starting from the top row down to the ith row. The…
leetcode.cn 2026-05-13
🟡1674.minimum-moves-to-make-array-complementary
🏷️ Tags
#array #hash_table #prefix_sum
🟡1674.minimum-moves-to-make-array-complementary
🏷️ Tags
#array #hash_table #prefix_sum
Telegraph
minimum-moves-to-make-array-complementary
给你一个长度为 偶数 n 的整数数组 nums 和一个整数 limit 。每一次操作,你可以将 nums 中的任何整数替换为 1 到 limit 之间的另一个整数。 如果对于所有下标 i(下标从 0 开始),nums[i] + nums[n - 1 - i] 都等于同一个数,则数组 nums 是 互补的 。例如,数组 [1,2,3,4] 是互补的,因为对于所有下标 i ,nums[i] + nums[n - 1 - i] = 5 。 返回使数组 互补 的 最少 操作次数。 示例 1: 输入:nums…
leetcode.com 2026-05-13
🟡1674.minimum-moves-to-make-array-complementary
🏷️ Tags
#array #hash_table #prefix_sum
🟡1674.minimum-moves-to-make-array-complementary
🏷️ Tags
#array #hash_table #prefix_sum
Telegraph
minimum-moves-to-make-array-complementary
You are given an integer array nums of even length n and an integer limit. In one move, you can replace any integer from nums with another integer between 1 and limit, inclusive. The array nums is complementary if for all indices i (0-indexed), nums[i] +…