leetcode.com 2026-03-17
🟡1727.largest-submatrix-with-rearrangements
🏷️ Tags
#greedy #array #matrix #sorting
🟡1727.largest-submatrix-with-rearrangements
🏷️ Tags
#greedy #array #matrix #sorting
Telegraph
largest-submatrix-with-rearrangements
You are given a binary matrix matrix of size m x n, and you are allowed to rearrange the columns of the matrix in any order. Return the area of the largest submatrix within matrix where every element of the submatrix is 1 after reordering the columns optimally.…
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-20
🟡3567.minimum-absolute-difference-in-sliding-submatrix
🏷️ Tags
#array #matrix #sorting
🟡3567.minimum-absolute-difference-in-sliding-submatrix
🏷️ Tags
#array #matrix #sorting
Telegraph
minimum-absolute-difference-in-sliding-submatrix
给你一个 m x n 的整数矩阵 grid 和一个整数 k。 对于矩阵 grid 中的每个连续的 k x k 子矩阵,计算其中任意两个 不同值 之间的 最小绝对差 。 返回一个大小为 (m - k + 1) x (n - k + 1) 的二维数组 ans,其中 ans[i][j] 表示以 grid 中坐标 (i, j) 为左上角的子矩阵的最小绝对差。 注意:如果子矩阵中的所有元素都相同,则答案为 0。 子矩阵 (x1, y1, x2, y2) 是一个由选择矩阵中所有满足 x1 <= x <= x2 且 y1…
leetcode.com 2026-03-20
🟡3567.minimum-absolute-difference-in-sliding-submatrix
🏷️ Tags
#array #matrix #sorting
🟡3567.minimum-absolute-difference-in-sliding-submatrix
🏷️ Tags
#array #matrix #sorting
Telegraph
minimum-absolute-difference-in-sliding-submatrix
You are given an m x n integer matrix grid and an integer k. For every contiguous k x k submatrix of grid, compute the minimum absolute difference between any two distinct values within that submatrix. Return a 2D array ans of size (m - k + 1) x (n - k +…
leetcode.cn 2026-03-22
🟢1886.determine-whether-matrix-can-be-obtained-by-rotation
🏷️ Tags
#array #matrix
🟢1886.determine-whether-matrix-can-be-obtained-by-rotation
🏷️ Tags
#array #matrix
Telegraph
determine-whether-matrix-can-be-obtained-by-rotation
给你两个大小为 n x n 的二进制矩阵 mat 和 target 。现 以 90 度顺时针轮转 矩阵 mat 中的元素 若干次 ,如果能够使 mat 与 target 一致,返回 true ;否则,返回 false 。 示例 1: 输入:mat = [[0,1],[1,0]], target = [[1,0],[0,1]] 输出:true 解释:顺时针轮转 90 度一次可以使 mat 和 target 一致。 示例 2: 输入:mat = [[0,1],[1,1]], target = [[1,0]…
leetcode.com 2026-03-22
🟢1886.determine-whether-matrix-can-be-obtained-by-rotation
🏷️ Tags
#array #matrix
🟢1886.determine-whether-matrix-can-be-obtained-by-rotation
🏷️ Tags
#array #matrix
Telegraph
determine-whether-matrix-can-be-obtained-by-rotation
Given two n x n binary matrices mat and target, return true if it is possible to make mat equal to target by rotating mat in 90-degree increments, or false otherwise. Example 1: Input: mat = [[0,1],[1,0]], target = [[1,0],[0,1]] Output: true Explanation:…
leetcode.cn 2026-03-23
🟡1594.maximum-non-negative-product-in-a-matrix
🏷️ Tags
#array #dynamic_programming #matrix
🟡1594.maximum-non-negative-product-in-a-matrix
🏷️ Tags
#array #dynamic_programming #matrix
Telegraph
maximum-non-negative-product-in-a-matrix
给你一个大小为 m x n 的矩阵 grid 。最初,你位于左上角 (0, 0) ,每一步,你可以在矩阵中 向右 或 向下 移动。 在从左上角 (0, 0) 开始到右下角 (m - 1, n - 1) 结束的所有路径中,找出具有 最大非负积 的路径。路径的积是沿路径访问的单元格中所有整数的乘积。 返回 最大非负积 对 109 + 7 取余 的结果。如果最大积为 负数 ,则返回 -1 。 注意,取余是在得到最大积之后执行的。 示例 1: 输入:grid = [[-1,-2,-3],[-2,-3,-3]…
❤1
leetcode.com 2026-03-23
🟡1594.maximum-non-negative-product-in-a-matrix
🏷️ Tags
#array #dynamic_programming #matrix
🟡1594.maximum-non-negative-product-in-a-matrix
🏷️ Tags
#array #dynamic_programming #matrix
Telegraph
maximum-non-negative-product-in-a-matrix
You are given a m x n matrix grid. Initially, you are located at the top-left corner (0, 0), and in each step, you can only move right or down in the matrix. Among all possible paths starting from the top-left corner (0, 0) and ending in the bottom-right…
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-03-27
🟢2946.matrix-similarity-after-cyclic-shifts
🏷️ Tags
#array #math #matrix #simulation
🟢2946.matrix-similarity-after-cyclic-shifts
🏷️ Tags
#array #math #matrix #simulation
Telegraph
matrix-similarity-after-cyclic-shifts
给你一个下标从 0 开始且大小为 m x n 的整数矩阵 mat 和一个整数 k 。请你将矩阵中的 奇数 行循环 右 移 k 次,偶数 行循环 左 移 k 次。 如果初始矩阵和最终矩阵完全相同,则返回 true ,否则返回 false 。 示例 1: 输入:mat = [[1,2,1,2],[5,5,5,5],[6,3,6,3]], k = 2 输出:true 解释: 初始矩阵如图一所示。 图二表示对奇数行右移一次且对偶数行左移一次后的矩阵状态。 图三是经过两次循环移位后的最终矩阵状态,与初始矩阵相同。…
leetcode.com 2026-03-27
🟢2946.matrix-similarity-after-cyclic-shifts
🏷️ Tags
#array #math #matrix #simulation
🟢2946.matrix-similarity-after-cyclic-shifts
🏷️ Tags
#array #math #matrix #simulation
Telegraph
matrix-similarity-after-cyclic-shifts
You are given an m x n integer matrix mat and an integer k. The matrix rows are 0-indexed. The following proccess happens k times: