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-16
🟡2975.maximum-square-area-by-removing-fences-from-a-field
🏷️ Tags
#array #hash_table #enumeration
🟡2975.maximum-square-area-by-removing-fences-from-a-field
🏷️ Tags
#array #hash_table #enumeration
Telegraph
maximum-square-area-by-removing-fences-from-a-field
有一个大型的 (m - 1) x (n - 1) 矩形田地,其两个对角分别是 (1, 1) 和 (m, n) ,田地内部有一些水平栅栏和垂直栅栏,分别由数组 hFences 和 vFences 给出。 水平栅栏为坐标 (hFences[i], 1) 到 (hFences[i], n),垂直栅栏为坐标 (1, vFences[i]) 到 (m, vFences[i]) 。 返回通过 移除 一些栅栏(可能不移除)所能形成的最大面积的 正方形 田地的面积,或者如果无法形成正方形田地则返回 -1。 由于答案可能很大,所以请返回结果对…
leetcode.com 2026-01-16
🟡2975.maximum-square-area-by-removing-fences-from-a-field
🏷️ Tags
#array #hash_table #enumeration
🟡2975.maximum-square-area-by-removing-fences-from-a-field
🏷️ Tags
#array #hash_table #enumeration
Telegraph
maximum-square-area-by-removing-fences-from-a-field
There is a large (m - 1) x (n - 1) rectangular field with corners at (1, 1) and (m, n) containing some horizontal and vertical fences given in arrays hFences and vFences respectively. Horizontal fences are from the coordinates (hFences[i], 1) to (hFences[i]…
leetcode.cn 2026-01-17
🟡3047.find-the-largest-area-of-square-inside-two-rectangles
🏷️ Tags
#geometry #array #math
🟡3047.find-the-largest-area-of-square-inside-two-rectangles
🏷️ Tags
#geometry #array #math
Telegraph
find-the-largest-area-of-square-inside-two-rectangles
在二维平面上存在 n 个矩形。给你两个下标从 0 开始的二维整数数组 bottomLeft 和 topRight,两个数组的大小都是 n x 2 ,其中 bottomLeft[i] 和 topRight[i] 分别代表第 i 个矩形的 左下角 和 右上角 坐标。 我们定义 向右 的方向为 x 轴正半轴(x 坐标增加),向左 的方向为 x 轴负半轴(x 坐标减少)。同样地,定义 向上 的方向为 y 轴正半轴(y 坐标增加),向下 的方向为 y 轴负半轴(y 坐标减少)。 你可以选择一个区域,该区域由两个矩形的…
leetcode.com 2026-01-17
🟡3047.find-the-largest-area-of-square-inside-two-rectangles
🏷️ Tags
#geometry #array #math
🟡3047.find-the-largest-area-of-square-inside-two-rectangles
🏷️ Tags
#geometry #array #math
Telegraph
find-the-largest-area-of-square-inside-two-rectangles
There exist n rectangles in a 2D plane with edges parallel to the x and y axis. You are given two 2D integer arrays bottomLeft and topRight where bottomLeft[i] = [a_i, b_i] and topRight[i] = [c_i, d_i] represent the bottom-left and top-right coordinates of…
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-01-22
🟢3507.minimum-pair-removal-to-sort-array-i
🏷️ Tags
#array #hash_table #linked_list #doubly_linked_list #ordered_set #simulation #heap_priority_queue
🟢3507.minimum-pair-removal-to-sort-array-i
🏷️ Tags
#array #hash_table #linked_list #doubly_linked_list #ordered_set #simulation #heap_priority_queue
Telegraph
minimum-pair-removal-to-sort-array-i
给你一个数组 nums,你可以执行以下操作任意次数:
leetcode.com 2026-01-22
🟢3507.minimum-pair-removal-to-sort-array-i
🏷️ Tags
#array #hash_table #linked_list #doubly_linked_list #ordered_set #simulation #heap_priority_queue
🟢3507.minimum-pair-removal-to-sort-array-i
🏷️ Tags
#array #hash_table #linked_list #doubly_linked_list #ordered_set #simulation #heap_priority_queue
Telegraph
minimum-pair-removal-to-sort-array-i
Given an array nums, you can perform the following operation any number of times:
leetcode.cn 2026-01-23
🔴3510.minimum-pair-removal-to-sort-array-ii
🏷️ Tags
#array #hash_table #linked_list #doubly_linked_list #ordered_set #simulation #heap_priority_queue
🔴3510.minimum-pair-removal-to-sort-array-ii
🏷️ Tags
#array #hash_table #linked_list #doubly_linked_list #ordered_set #simulation #heap_priority_queue
Telegraph
minimum-pair-removal-to-sort-array-ii
给你一个数组 nums,你可以执行以下操作任意次数:
leetcode.com 2026-01-23
🔴3510.minimum-pair-removal-to-sort-array-ii
🏷️ Tags
#array #hash_table #linked_list #doubly_linked_list #ordered_set #simulation #heap_priority_queue
🔴3510.minimum-pair-removal-to-sort-array-ii
🏷️ Tags
#array #hash_table #linked_list #doubly_linked_list #ordered_set #simulation #heap_priority_queue
Telegraph
minimum-pair-removal-to-sort-array-ii
Given an array nums, you can perform the following operation any number of times: