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-02-07
🟡1653.minimum-deletions-to-make-string-balanced
🏷️ Tags
#stack #string #dynamic_programming
🟡1653.minimum-deletions-to-make-string-balanced
🏷️ Tags
#stack #string #dynamic_programming
Telegraph
minimum-deletions-to-make-string-balanced
给你一个字符串 s ,它仅包含字符 'a' 和 'b' 。 你可以删除 s 中任意数目的字符,使得 s 平衡 。当不存在下标对 (i,j) 满足 i < j ,且 s[i] = 'b' 的同时 s[j]= 'a' ,此时认为 s 是 平衡 的。 请你返回使 s 平衡 的 最少 删除次数。 示例 1: 输入:s = "aababbab" 输出:2 解释:你可以选择以下任意一种方案: 下标从 0 开始,删除第 2 和第 6 个字符("aababbab" -> "aaabbb"), 下标从 0 开始,删除第…
leetcode.com 2026-02-07
🟡1653.minimum-deletions-to-make-string-balanced
🏷️ Tags
#stack #string #dynamic_programming
🟡1653.minimum-deletions-to-make-string-balanced
🏷️ Tags
#stack #string #dynamic_programming
Telegraph
minimum-deletions-to-make-string-balanced
You are given a string s consisting only of characters 'a' and 'b'. You can delete any number of characters in s to make s balanced. s is balanced if there is no pair of indices (i,j) such that i < j and s[i] = 'b' and s[j]= 'a'. Return the minimum number…
leetcode.cn 2026-06-14
🟡2130.maximum-twin-sum-of-a-linked-list
🏷️ Tags
#stack #linked_list #two_pointers
🟡2130.maximum-twin-sum-of-a-linked-list
🏷️ Tags
#stack #linked_list #two_pointers
Telegraph
maximum-twin-sum-of-a-linked-list
在一个大小为 n 且 n 为 偶数 的链表中,对于 0 <= i <= (n / 2) - 1 的 i ,第 i 个节点(下标从 0 开始)的孪生节点为第 (n-1-i) 个节点 。
leetcode.com 2026-06-14
🟡2130.maximum-twin-sum-of-a-linked-list
🏷️ Tags
#stack #linked_list #two_pointers
🟡2130.maximum-twin-sum-of-a-linked-list
🏷️ Tags
#stack #linked_list #two_pointers
Telegraph
maximum-twin-sum-of-a-linked-list
In a linked list of size n, where n is even, the ith node (0-indexed) of the linked list is known as the twin of the (n-1-i)th node, if 0 <= i <= (n / 2) - 1.
leetcode.cn 2026-07-19
🟡1081.smallest-subsequence-of-distinct-characters
🏷️ Tags
#stack #greedy #string #monotonic_stack
🟡1081.smallest-subsequence-of-distinct-characters
🏷️ Tags
#stack #greedy #string #monotonic_stack
Telegraph
smallest-subsequence-of-distinct-characters
返回 s 字典序最小的子序列,该子序列包含 s 的所有不同字符,且只包含一次。 示例 1: 输入:s = "bcabc" 输出:"abc" 示例 2: 输入:s = "cbacdcbc" 输出:"acdb" 提示:
leetcode.com 2026-07-19
🟡1081.smallest-subsequence-of-distinct-characters
🏷️ Tags
#stack #greedy #string #monotonic_stack
🟡1081.smallest-subsequence-of-distinct-characters
🏷️ Tags
#stack #greedy #string #monotonic_stack
Telegraph
smallest-subsequence-of-distinct-characters
Given a string s, return the lexicographically smallest subsequence of s that contains all the distinct characters of s exactly once. Example 1: Input: s = "bcabc" Output: "abc" Example 2: Input: s = "cbacdcbc" Output: "acdb" Constraints:
leetcode.com 2026-09-25
🔴1096.brace-expansion-ii
🏷️ Tags
#stack #breadth_first_search #hash_table #string #backtracking #sorting
🔴1096.brace-expansion-ii
🏷️ Tags
#stack #breadth_first_search #hash_table #string #backtracking #sorting
Telegraph
brace-expansion-ii
Under the grammar given below, strings can represent a set of lowercase words. Let R(expr) denote the set of words the expression represents. The grammar can best be understood through simple examples:
leetcode.cn 2026-09-27
🟡1190.reverse-substrings-between-each-pair-of-parentheses
🏷️ Tags
#stack #string #bracket_sequences
🟡1190.reverse-substrings-between-each-pair-of-parentheses
🏷️ Tags
#stack #string #bracket_sequences
Telegraph
reverse-substrings-between-each-pair-of-parentheses
给出一个字符串 s(仅含有小写英文字母和括号)。 请你按照从括号内到外的顺序,逐层反转每对匹配括号中的字符串,并返回最终的结果。 注意,您的结果中 不应 包含任何括号。 示例 1: 输入:s = "(abcd)" 输出:"dcba" 示例 2: 输入:s = "(u(love)i)" 输出:"iloveu" 解释:先反转子字符串 "love" ,然后反转整个字符串。 示例 3: 输入:s = "(ed(et(oc))el)" 输出:"leetcode" 解释:先反转子字符串 "oc" ,接着反转 "etco"…
leetcode.com 2026-09-27
🟡1190.reverse-substrings-between-each-pair-of-parentheses
🏷️ Tags
#stack #string #bracket_sequences
🟡1190.reverse-substrings-between-each-pair-of-parentheses
🏷️ Tags
#stack #string #bracket_sequences
Telegraph
reverse-substrings-between-each-pair-of-parentheses
You are given a string s that consists of lower case English letters and brackets. Reverse the strings in each pair of matching parentheses, starting from the innermost one. Your result should not contain any brackets. Example 1: Input: s = "(abcd)" Output:…
leetcode.cn 2026-09-28
🟢1614.maximum-nesting-depth-of-the-parentheses
🏷️ Tags
#stack #string #bracket_sequences
🟢1614.maximum-nesting-depth-of-the-parentheses
🏷️ Tags
#stack #string #bracket_sequences
Telegraph
maximum-nesting-depth-of-the-parentheses
给定 有效括号字符串 s,返回 s 的 嵌套深度。嵌套深度是嵌套括号的 最大 数量。 示例 1: 输入:s = "(1+(2*3)+((8)/4))+1" 输出:3 解释:数字 8 在嵌套的 3 层括号中。 示例 2: 输入:s = "(1)+((2))+(((3)))" 输出:3 解释:数字 3 在嵌套的 3 层括号中。 示例 3: 输入:s = "()(())((()()))" 输出:3 提示:
leetcode.com 2026-09-28
🟢1614.maximum-nesting-depth-of-the-parentheses
🏷️ Tags
#stack #string #bracket_sequences
🟢1614.maximum-nesting-depth-of-the-parentheses
🏷️ Tags
#stack #string #bracket_sequences
Telegraph
maximum-nesting-depth-of-the-parentheses
Given a valid parentheses string s, return the nesting depth of s. The nesting depth is the maximum number of nested parentheses. Example 1: Input: s = "(1+(2*3)+((8)/4))+1" Output: 3 Explanation: Digit 8 is inside of 3 nested parentheses in the string.…
leetcode.cn 2026-09-30
🟡1111.maximum-nesting-depth-of-two-valid-parentheses-strings
🏷️ Tags
#stack #string #bracket_sequences
🟡1111.maximum-nesting-depth-of-two-valid-parentheses-strings
🏷️ Tags
#stack #string #bracket_sequences
Telegraph
maximum-nesting-depth-of-two-valid-parentheses-strings
如果一个字符串仅由字符 "(" 和 ")" 组成,并且满足以下条件,则称为有效括号字符串(VPS):
leetcode.com 2026-09-30
🟡1111.maximum-nesting-depth-of-two-valid-parentheses-strings
🏷️ Tags
#stack #string #bracket_sequences
🟡1111.maximum-nesting-depth-of-two-valid-parentheses-strings
🏷️ Tags
#stack #string #bracket_sequences
Telegraph
maximum-nesting-depth-of-two-valid-parentheses-strings
A string is a valid parentheses string (denoted VPS) if and only if it consists of "(" and ")" characters only, and: