leetcode.cn 2026-01-14
🔴3454.separate-squares-ii
🏷️ Tags
#segment_tree #array #binary_search #line_sweep
🔴3454.separate-squares-ii
🏷️ Tags
#segment_tree #array #binary_search #line_sweep
Telegraph
separate-squares-ii
给你一个二维整数数组 squares ,其中 squares[i] = [xi, yi, li] 表示一个与 x 轴平行的正方形的左下角坐标和正方形的边长。 找到一个最小的 y 坐标,它对应一条水平线,该线需要满足它以上正方形的总面积 等于 该线以下正方形的总面积。 答案如果与实际答案的误差在 10-5 以内,将视为正确答案。 注意:正方形 可能会 重叠。重叠区域只 统计一次 。 示例 1: 输入: squares = [[0,0,1],[2,2,1]] 输出: 1.00000 解释: 任何在 y =…
leetcode.com 2026-01-14
🔴3454.separate-squares-ii
🏷️ Tags
#segment_tree #array #binary_search #line_sweep
🔴3454.separate-squares-ii
🏷️ Tags
#segment_tree #array #binary_search #line_sweep
Telegraph
separate-squares-ii
You are given a 2D integer array squares. Each squares[i] = [xi, yi, li] represents the coordinates of the bottom-left point and the side length of a square parallel to the x-axis. Find the minimum y-coordinate value of a horizontal line such that the total…
leetcode.cn 2026-01-19
🟡1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold
🏷️ Tags
#array #binary_search #matrix #prefix_sum
🟡1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold
🏷️ Tags
#array #binary_search #matrix #prefix_sum
Telegraph
maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold
给你一个大小为 m x n 的矩阵 mat 和一个整数阈值 threshold。 请你返回元素总和小于或等于阈值的正方形区域的最大边长;如果没有这样的正方形区域,则返回 0 。 示例 1: 输入:mat = [[1,1,3,2,4,3,2],[1,1,3,2,4,3,2],[1,1,3,2,4,3,2]], threshold = 4 输出:2 解释:总和小于或等于 4 的正方形的最大边长为 2,如图所示。 示例 2: 输入:mat = [[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2…
leetcode.com 2026-01-19
🟡1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold
🏷️ Tags
#array #binary_search #matrix #prefix_sum
🟡1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold
🏷️ Tags
#array #binary_search #matrix #prefix_sum
Telegraph
maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold
Given a m x n matrix mat and an integer threshold, return the maximum side-length of a square with a sum less than or equal to threshold or return 0 if there is no such square. Example 1: Input: mat = [[1,1,3,2,4,3,2],[1,1,3,2,4,3,2],[1,1,3,2,4,3,2]], threshold…
leetcode.cn 2026-02-09
🟡1382.balance-a-binary-search-tree
🏷️ Tags
#greedy #tree #depth_first_search #binary_search_tree #divide_and_conquer #binary_tree
🟡1382.balance-a-binary-search-tree
🏷️ Tags
#greedy #tree #depth_first_search #binary_search_tree #divide_and_conquer #binary_tree
Telegraph
balance-a-binary-search-tree
给你一棵二叉搜索树,请你返回一棵 平衡后 的二叉搜索树,新生成的树应该与原来的树有着相同的节点值。如果有多种构造方法,请你返回任意一种。 如果一棵二叉搜索树中,每个节点的两棵子树高度差不超过 1 ,我们就称这棵二叉搜索树是 平衡的 。 示例 1: 输入:root = [1,null,2,null,3,null,4,null,null] 输出:[2,1,3,null,null,null,4] 解释:这不是唯一的正确答案,[3,1,4,null,2,null,null] 也是一个可行的构造方案。 示例 2:…
leetcode.com 2026-02-09
🟡1382.balance-a-binary-search-tree
🏷️ Tags
#greedy #tree #depth_first_search #binary_search_tree #divide_and_conquer #binary_tree
🟡1382.balance-a-binary-search-tree
🏷️ Tags
#greedy #tree #depth_first_search #binary_search_tree #divide_and_conquer #binary_tree
Telegraph
balance-a-binary-search-tree
Given the root of a binary search tree, return a balanced binary search tree with the same node values. If there is more than one answer, return any of them. A binary search tree is balanced if the depth of the two subtrees of every node never differs by…
leetcode.cn 2026-03-12
🔴3600.maximize-spanning-tree-stability-with-upgrades
🏷️ Tags
#greedy #union_find #graph #binary_search #minimum_spanning_tree
🔴3600.maximize-spanning-tree-stability-with-upgrades
🏷️ Tags
#greedy #union_find #graph #binary_search #minimum_spanning_tree
Telegraph
maximize-spanning-tree-stability-with-upgrades
给你一个整数 n,表示编号从 0 到 n - 1 的 n 个节点,以及一个 edges 列表,其中 edges[i] = [ui, vi, si, musti]:
leetcode.com 2026-03-12
🔴3600.maximize-spanning-tree-stability-with-upgrades
🏷️ Tags
#greedy #union_find #graph #binary_search #minimum_spanning_tree
🔴3600.maximize-spanning-tree-stability-with-upgrades
🏷️ Tags
#greedy #union_find #graph #binary_search #minimum_spanning_tree
Telegraph
maximize-spanning-tree-stability-with-upgrades
You are given an integer n, representing n nodes numbered from 0 to n - 1 and a list of edges, where edges[i] = [ui, vi, si, musti]:
leetcode.cn 2026-03-13
🟡3296.minimum-number-of-seconds-to-make-mountain-height-zero
🏷️ Tags
#greedy #array #math #binary_search #heap_priority_queue
🟡3296.minimum-number-of-seconds-to-make-mountain-height-zero
🏷️ Tags
#greedy #array #math #binary_search #heap_priority_queue
Telegraph
minimum-number-of-seconds-to-make-mountain-height-zero
给你一个整数 mountainHeight 表示山的高度。 同时给你一个整数数组 workerTimes,表示工人们的工作时间(单位:秒)。 工人们需要 同时 进行工作以 降低 山的高度。对于工人 i :
leetcode.com 2026-03-13
🟡3296.minimum-number-of-seconds-to-make-mountain-height-zero
🏷️ Tags
#greedy #array #math #binary_search #heap_priority_queue
🟡3296.minimum-number-of-seconds-to-make-mountain-height-zero
🏷️ Tags
#greedy #array #math #binary_search #heap_priority_queue
Telegraph
minimum-number-of-seconds-to-make-mountain-height-zero
You are given an integer mountainHeight denoting the height of a mountain. You are also given an integer array workerTimes representing the work time of workers in seconds. The workers work simultaneously to reduce the height of the mountain. For worker i:
leetcode.cn 2026-04-03
🔴3661.maximum-walls-destroyed-by-robots
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
🔴3661.maximum-walls-destroyed-by-robots
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
Telegraph
maximum-walls-destroyed-by-robots
robots[i] 是第 i 个机器人的位置。
leetcode.com 2026-04-03
🔴3661.maximum-walls-destroyed-by-robots
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
🔴3661.maximum-walls-destroyed-by-robots
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
Telegraph
maximum-walls-destroyed-by-robots
robots[i] is the position of the ith robot.
leetcode.cn 2026-04-19
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
Telegraph
maximum-distance-between-a-pair-of-values
给你两个 非递增 的整数数组 nums1 和 nums2 ,数组下标均 从 0 开始 计数。 下标对 (i, j) 中 0 <= i < nums1.length 且 0 <= j < nums2.length 。如果该下标对同时满足 i <= j 且 nums1[i] <= nums2[j] ,则称之为 有效 下标对,该下标对的 距离 为 j - i 。 返回所有 有效 下标对 (i, j) 中的 最大距离 。如果不存在有效下标对,返回 0 。 一个数组 arr ,如果每个…
leetcode.com 2026-04-19
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
Telegraph
maximum-distance-between-a-pair-of-values
You are given two non-increasing 0-indexed integer arrays nums1 and nums2. A pair of indices (i, j), where 0 <= i < nums1.length and 0 <= j < nums2.length, is valid if both i <= j and nums1[i] <= nums2[j]. The distance of the pair is j - i.…
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]…