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-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:
leetcode.cn 2026-04-17
🟡3761.minimum-absolute-distance-between-mirror-pairs
🏷️ Tags
#array #hash_table #math
🟡3761.minimum-absolute-distance-between-mirror-pairs
🏷️ Tags
#array #hash_table #math
Telegraph
minimum-absolute-distance-between-mirror-pairs
给你一个整数数组 nums。
leetcode.com 2026-04-17
🟡3761.minimum-absolute-distance-between-mirror-pairs
🏷️ Tags
#array #hash_table #math
🟡3761.minimum-absolute-distance-between-mirror-pairs
🏷️ Tags
#array #hash_table #math
Telegraph
minimum-absolute-distance-between-mirror-pairs
You are given an integer array nums. A mirror pair is a pair of indices (i, j) such that:
leetcode.cn 2026-04-25
🔴3464.maximize-the-distance-between-points-on-a-square
🏷️ Tags
#geometry #array #math #binary_search #sorting
🔴3464.maximize-the-distance-between-points-on-a-square
🏷️ Tags
#geometry #array #math #binary_search #sorting
Telegraph
maximize-the-distance-between-points-on-a-square
给你一个整数 side,表示一个正方形的边长,正方形的四个角分别位于笛卡尔平面的 (0, 0) ,(0, side) ,(side, 0) 和 (side, side) 处。
leetcode.com 2026-04-25
🔴3464.maximize-the-distance-between-points-on-a-square
🏷️ Tags
#geometry #array #math #binary_search #sorting
🔴3464.maximize-the-distance-between-points-on-a-square
🏷️ Tags
#geometry #array #math #binary_search #sorting
Telegraph
maximize-the-distance-between-points-on-a-square
You are given an integer side, representing the edge length of a square with corners at (0, 0), (0, side), (side, 0), and (side, side) on a Cartesian plane. You are also given a positive integer k and a 2D integer array points, where points[i] = [xi, yi]…
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-05-08
🟡3629.minimum-jumps-to-reach-end-via-prime-teleportation
🏷️ Tags
#breadth_first_search #array #hash_table #math #number_theory
🟡3629.minimum-jumps-to-reach-end-via-prime-teleportation
🏷️ Tags
#breadth_first_search #array #hash_table #math #number_theory
Telegraph
minimum-jumps-to-reach-end-via-prime-teleportation
给你一个长度为 n 的整数数组 nums。
leetcode.com 2026-05-08
🟡3629.minimum-jumps-to-reach-end-via-prime-teleportation
🏷️ Tags
#breadth_first_search #array #hash_table #math #number_theory
🟡3629.minimum-jumps-to-reach-end-via-prime-teleportation
🏷️ Tags
#breadth_first_search #array #hash_table #math #number_theory
Telegraph
minimum-jumps-to-reach-end-via-prime-teleportation
You are given an integer array nums of length n. You start at index 0, and your goal is to reach index n - 1. From any index i, you may perform one of the following operations: