leetcode.cn 2026-03-28
🔴2573.find-the-string-with-lcp
🏷️ Tags
#greedy #union_find #array #string #dynamic_programming #matrix
🔴2573.find-the-string-with-lcp
🏷️ Tags
#greedy #union_find #array #string #dynamic_programming #matrix
Telegraph
find-the-string-with-lcp
对任一由 n 个小写英文字母组成的字符串 word ,我们可以定义一个 n x n 的矩阵,并满足:
leetcode.cn 2026-04-02
🟡3418.maximum-amount-of-money-robot-can-earn
🏷️ Tags
#array #dynamic_programming #matrix
🟡3418.maximum-amount-of-money-robot-can-earn
🏷️ Tags
#array #dynamic_programming #matrix
Telegraph
maximum-amount-of-money-robot-can-earn
给你一个 m x n 的网格。一个机器人从网格的左上角 (0, 0) 出发,目标是到达网格的右下角 (m - 1, n - 1)。在任意时刻,机器人只能向右或向下移动。 网格中的每个单元格包含一个值 coins[i][j]:
leetcode.com 2026-04-02
🟡3418.maximum-amount-of-money-robot-can-earn
🏷️ Tags
#array #dynamic_programming #matrix
🟡3418.maximum-amount-of-money-robot-can-earn
🏷️ Tags
#array #dynamic_programming #matrix
Telegraph
maximum-amount-of-money-robot-can-earn
You are given an m x n grid. A robot starts at the top-left corner of the grid (0, 0) and wants to reach the bottom-right corner (m - 1, n - 1). The robot can move either right or down at any point in time. The grid contains a value coins[i][j] in each cell:
leetcode.cn 2026-04-26
🟡1559.detect-cycles-in-2d-grid
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
🟡1559.detect-cycles-in-2d-grid
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
Telegraph
detect-cycles-in-2d-grid
给你一个二维字符网格数组 grid ,大小为 m x n ,你需要检查 grid 中是否存在 相同值 形成的环。 一个环是一条开始和结束于同一个格子的长度 大于等于 4 的路径。对于一个给定的格子,你可以移动到它上、下、左、右四个方向相邻的格子之一,可以移动的前提是这两个格子有 相同的值 。 同时,你也不能回到上一次移动时所在的格子。比方说,环 (1, 1) -> (1, 2) -> (1, 1) 是不合法的,因为从 (1, 2) 移动到 (1, 1) 回到了上一次移动时的格子。 如果 grid 中有相同值形成的环,请你返回…
leetcode.com 2026-04-26
🟡1559.detect-cycles-in-2d-grid
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
🟡1559.detect-cycles-in-2d-grid
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
Telegraph
detect-cycles-in-2d-grid
Given a 2D array of characters grid of size m x n, you need to find if there exists any cycle consisting of the same value in grid. A cycle is a path of length 4 or more in the grid that starts and ends at the same cell. From a given cell, you can move to…
leetcode.cn 2026-04-27
🟡1391.check-if-there-is-a-valid-path-in-a-grid
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
🟡1391.check-if-there-is-a-valid-path-in-a-grid
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
Telegraph
check-if-there-is-a-valid-path-in-a-grid
给你一个 m x n 的网格 grid。网格里的每个单元都代表一条街道。grid[i][j] 的街道可以是:
leetcode.com 2026-04-27
🟡1391.check-if-there-is-a-valid-path-in-a-grid
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
🟡1391.check-if-there-is-a-valid-path-in-a-grid
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #matrix
Telegraph
check-if-there-is-a-valid-path-in-a-grid
You are given an m x n grid. Each cell of grid represents a street. The street of grid[i][j] can be:
leetcode.cn 2026-04-28
🟡2033.minimum-operations-to-make-a-uni-value-grid
🏷️ Tags
#array #math #matrix #sorting
🟡2033.minimum-operations-to-make-a-uni-value-grid
🏷️ Tags
#array #math #matrix #sorting
Telegraph
minimum-operations-to-make-a-uni-value-grid
给你一个大小为 m x n 的二维整数网格 grid 和一个整数 x 。每一次操作,你可以对 grid 中的任一元素 加 x 或 减 x 。 单值网格 是全部元素都相等的网格。 返回使网格化为单值网格所需的 最小 操作数。如果不能,返回 -1 。 示例 1: 输入:grid = [[2,4],[6,8]], x = 2 输出:4 解释:可以执行下述操作使所有元素都等于 4 : - 2 加 x 一次。 - 6 减 x 一次。 - 8 减 x 两次。 共计 4 次操作。 示例 2: 输入:grid = [[1…
leetcode.com 2026-04-28
🟡2033.minimum-operations-to-make-a-uni-value-grid
🏷️ Tags
#array #math #matrix #sorting
🟡2033.minimum-operations-to-make-a-uni-value-grid
🏷️ Tags
#array #math #matrix #sorting
Telegraph
minimum-operations-to-make-a-uni-value-grid
You are given a 2D integer grid of size m x n and an integer x. In one operation, you can add x to or subtract x from any element in the grid. A uni-value grid is a grid where all the elements of it are equal. Return the minimum number of operations to make…
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…