leetcode.com 2026-01-10
🟡712.minimum-ascii-delete-sum-for-two-strings
🏷️ Tags
#string #dynamic_programming
🟡712.minimum-ascii-delete-sum-for-two-strings
🏷️ Tags
#string #dynamic_programming
Telegraph
minimum-ascii-delete-sum-for-two-strings
Given two strings s1 and s2, return the lowest ASCII sum of deleted characters to make two strings equal. Example 1: Input: s1 = "sea", s2 = "eat" Output: 231 Explanation: Deleting "s" from "sea" adds the ASCII value of "s" (115) to the sum. Deleting "t"…
leetcode.cn 2026-01-11
🔴85.maximal-rectangle
🏷️ Tags
#stack #array #dynamic_programming #matrix #monotonic_stack
🔴85.maximal-rectangle
🏷️ Tags
#stack #array #dynamic_programming #matrix #monotonic_stack
Telegraph
maximal-rectangle
给定一个仅包含 0 和 1 、大小为 rows x cols 的二维二进制矩阵,找出只包含 1 的最大矩形,并返回其面积。 示例 1: 输入:matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]] 输出:6 解释:最大矩形如上图所示。 示例 2: 输入:matrix = [["0"]] 输出:0 示例 3: 输入:matrix = [["1"]] 输出:1 …
leetcode.com 2026-01-11
🔴85.maximal-rectangle
🏷️ Tags
#stack #array #dynamic_programming #matrix #monotonic_stack
🔴85.maximal-rectangle
🏷️ Tags
#stack #array #dynamic_programming #matrix #monotonic_stack
Telegraph
maximal-rectangle
Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. Example 1: Input: matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]] Output: 6…
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…