leetcode.cn 2026-09-29
🔴2267.check-if-there-is-a-valid-parentheses-string-path
🏷️ Tags
#array #dynamic_programming #matrix #bracket_sequences
🔴2267.check-if-there-is-a-valid-parentheses-string-path
🏷️ Tags
#array #dynamic_programming #matrix #bracket_sequences
Telegraph
check-if-there-is-a-valid-parentheses-string-path
一个括号字符串是一个 非空 且只包含 '(' 和 ')' 的字符串。如果下面 任意 条件为 真 ,那么这个括号字符串就是 合法的 。
leetcode.com 2026-09-29
🔴2267.check-if-there-is-a-valid-parentheses-string-path
🏷️ Tags
#array #dynamic_programming #matrix #bracket_sequences
🔴2267.check-if-there-is-a-valid-parentheses-string-path
🏷️ Tags
#array #dynamic_programming #matrix #bracket_sequences
Telegraph
check-if-there-is-a-valid-parentheses-string-path
A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any of the following conditions is true:
leetcode.com 2026-10-02
🟡22.generate-parentheses
🏷️ Tags
#string #dynamic_programming #backtracking #bracket_sequences
🟡22.generate-parentheses
🏷️ Tags
#string #dynamic_programming #backtracking #bracket_sequences
Telegraph
generate-parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example 1: Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"] Example 2: Input: n = 1 Output: ["()"] Constraints:
leetcode.cn 2026-10-03
🔴32.longest-valid-parentheses
🏷️ Tags
#stack #string #dynamic_programming #bracket_sequences
🔴32.longest-valid-parentheses
🏷️ Tags
#stack #string #dynamic_programming #bracket_sequences
Telegraph
longest-valid-parentheses
给你一个只包含 '(' 和 ')' 的字符串,找出最长有效(格式正确且连续)括号 子串 的长度。 左右括号匹配,即每个左括号都有对应的右括号将其闭合的字符串是格式正确的,比如 "(()())"。 示例 1: 输入:s = "(()" 输出:2 解释:最长有效括号子串是 "()" 示例 2: 输入:s = ")()())" 输出:4 解释:最长有效括号子串是 "()()" 示例 3: 输入:s = "" 输出:0 提示:
leetcode.com 2026-10-03
🔴32.longest-valid-parentheses
🏷️ Tags
#stack #string #dynamic_programming #bracket_sequences
🔴32.longest-valid-parentheses
🏷️ Tags
#stack #string #dynamic_programming #bracket_sequences
Telegraph
longest-valid-parentheses
Given a string containing just the characters '(' and ')', return the length of the longest valid (well-formed) parentheses substring. Example 1: Input: s = "(()" Output: 2 Explanation: The longest valid parentheses substring is "()". Example 2: Input:…
leetcode.cn 2026-10-04
🟡678.valid-parenthesis-string
🏷️ Tags
#stack #greedy #string #dynamic_programming #bracket_sequences
🟡678.valid-parenthesis-string
🏷️ Tags
#stack #greedy #string #dynamic_programming #bracket_sequences
Telegraph
valid-parenthesis-string
给你一个只包含三种字符的字符串,支持的字符类型分别是 '('、')' 和 '*'。请你检验这个字符串是否为有效字符串,如果是 有效 字符串返回 true 。 有效 字符串符合如下规则:
leetcode.com 2026-10-04
🟡678.valid-parenthesis-string
🏷️ Tags
#stack #greedy #string #dynamic_programming #bracket_sequences
🟡678.valid-parenthesis-string
🏷️ Tags
#stack #greedy #string #dynamic_programming #bracket_sequences
Telegraph
valid-parenthesis-string
Given a string s containing only three types of characters: '(', ')' and '*', return true if s is valid. The following rules define a valid string:
leetcode.cn 2026-10-18
🔴1569.number-of-ways-to-reorder-array-to-get-same-bst
🏷️ Tags
#tree #union_find #binary_search_tree #memoization #array #math #divide_and_conquer #dynamic_programming #binary_tree #combinatorics #fermats_little_theorem
🔴1569.number-of-ways-to-reorder-array-to-get-same-bst
🏷️ Tags
#tree #union_find #binary_search_tree #memoization #array #math #divide_and_conquer #dynamic_programming #binary_tree #combinatorics #fermats_little_theorem
Telegraph
number-of-ways-to-reorder-array-to-get-same-bst
给你一个数组 nums 表示 1 到 n 的一个排列。我们按照元素在 nums 中的顺序依次插入一个初始为空的二叉搜索树(BST)。请你统计将 nums 重新排序后,统计满足如下条件的方案数:重排后得到的二叉搜索树与 nums 原本数字顺序得到的二叉搜索树相同。
leetcode.com 2026-10-18
🔴1569.number-of-ways-to-reorder-array-to-get-same-bst
🏷️ Tags
#tree #union_find #binary_search_tree #memoization #array #math #divide_and_conquer #dynamic_programming #binary_tree #combinatorics #fermats_little_theorem
🔴1569.number-of-ways-to-reorder-array-to-get-same-bst
🏷️ Tags
#tree #union_find #binary_search_tree #memoization #array #math #divide_and_conquer #dynamic_programming #binary_tree #combinatorics #fermats_little_theorem
Telegraph
number-of-ways-to-reorder-array-to-get-same-bst
Given an array nums that represents a permutation of integers from 1 to n. We are going to construct a binary search tree (BST) by inserting the elements of nums in order into an initially empty BST. Find the number of different ways to reorder nums so that…
leetcode.cn 2026-10-28
🟡3882.minimum-xor-path-in-a-grid
🏷️ Tags
#bit_manipulation #array #dynamic_programming #matrix
🟡3882.minimum-xor-path-in-a-grid
🏷️ Tags
#bit_manipulation #array #dynamic_programming #matrix
Telegraph
minimum-xor-path-in-a-grid
给你一个大小为 m * n 的二维整数数组 grid。
leetcode.com 2026-10-28
🟡3882.minimum-xor-path-in-a-grid
🏷️ Tags
#bit_manipulation #array #dynamic_programming #matrix
🟡3882.minimum-xor-path-in-a-grid
🏷️ Tags
#bit_manipulation #array #dynamic_programming #matrix
Telegraph
minimum-xor-path-in-a-grid
You are given a 2D integer array grid of size m * n. You start at the top-left cell (0, 0) and want to reach the bottom-right cell (m - 1, n - 1). At each step, you may move either right or down. The cost of a path is defined as the bitwise XOR of all the…
leetcode.cn 2026-11-04
🔴3505.minimum-operations-to-make-elements-within-k-subarrays-equal
🏷️ Tags
#array #hash_table #math #dynamic_programming #sliding_window #heap_priority_queue
🔴3505.minimum-operations-to-make-elements-within-k-subarrays-equal
🏷️ Tags
#array #hash_table #math #dynamic_programming #sliding_window #heap_priority_queue
Telegraph
minimum-operations-to-make-elements-within-k-subarrays-equal
给你一个整数数组 nums 和两个整数 x 和 k。你可以执行以下操作任意次(包括零次):
leetcode.com 2026-11-04
🔴3505.minimum-operations-to-make-elements-within-k-subarrays-equal
🏷️ Tags
#array #hash_table #math #dynamic_programming #sliding_window #heap_priority_queue
🔴3505.minimum-operations-to-make-elements-within-k-subarrays-equal
🏷️ Tags
#array #hash_table #math #dynamic_programming #sliding_window #heap_priority_queue
Telegraph
minimum-operations-to-make-elements-within-k-subarrays-equal
You are given an integer array nums and two integers, x and k. You can perform the following operation any number of times (including zero):
leetcode.cn 2026-11-15
🟡1524.number-of-sub-arrays-with-odd-sum
🏷️ Tags
#array #math #dynamic_programming #prefix_sum
🟡1524.number-of-sub-arrays-with-odd-sum
🏷️ Tags
#array #math #dynamic_programming #prefix_sum
Telegraph
number-of-sub-arrays-with-odd-sum
给你一个整数数组 arr 。请你返回和为 奇数 的子数组数目。 由于答案可能会很大,请你将结果对 10^9 + 7 取余后返回。 示例 1: 输入:arr = [1,3,5] 输出:4 解释:所有的子数组为 [[1],[1,3],[1,3,5],[3],[3,5],[5]] 。 所有子数组的和为 [1,4,9,3,8,5]. 奇数和包括 [1,9,3,5] ,所以答案为 4 。 示例 2 : 输入:arr = [2,4,6] 输出:0 解释:所有子数组为 [[2],[2,4],[2,4,6],[4]…
leetcode.com 2026-11-15
🟡1524.number-of-sub-arrays-with-odd-sum
🏷️ Tags
#array #math #dynamic_programming #prefix_sum
🟡1524.number-of-sub-arrays-with-odd-sum
🏷️ Tags
#array #math #dynamic_programming #prefix_sum
Telegraph
number-of-sub-arrays-with-odd-sum
Given an array of integers arr, return the number of subarrays with an odd sum. Since the answer can be very large, return it modulo 109 + 7. Example 1: Input: arr = [1,3,5] Output: 4 Explanation: All subarrays are [[1],[1,3],[1,3,5],[3],[3,5],[5]] All…
leetcode.cn 2026-11-17
🔴2911.minimum-changes-to-make-k-semi-palindromes
🏷️ Tags
#two_pointers #string #dynamic_programming
🔴2911.minimum-changes-to-make-k-semi-palindromes
🏷️ Tags
#two_pointers #string #dynamic_programming
Telegraph
minimum-changes-to-make-k-semi-palindromes
给你一个字符串 s 和一个整数 k,请将 s 划分为 k 个 非空子串 ,使得将每个子串变为 半回文串 所需的字符修改次数之和最小。 返回所需的 最少 字符修改次数。 半回文串 是一类特殊的字符串:它可以按照某种重复模式拆分后,使每一组都成为 回文串 。判断一个字符串是否为半回文串的方法如下:
leetcode.com 2026-11-17
🔴2911.minimum-changes-to-make-k-semi-palindromes
🏷️ Tags
#two_pointers #string #dynamic_programming
🔴2911.minimum-changes-to-make-k-semi-palindromes
🏷️ Tags
#two_pointers #string #dynamic_programming
Telegraph
minimum-changes-to-make-k-semi-palindromes
Given a string s and an integer k, partition s into k substrings such that the letter changes needed to make each substring a semi-palindrome are minimized. Return the minimum number of letter changes required. A semi-palindrome is a special type of string…