leetcode.com 2026-09-16
🟡1621.number-of-sets-of-k-non-overlapping-line-segments
🏷️ Tags
#math #dynamic_programming #combinatorics #prefix_sum
🟡1621.number-of-sets-of-k-non-overlapping-line-segments
🏷️ Tags
#math #dynamic_programming #combinatorics #prefix_sum
Telegraph
number-of-sets-of-k-non-overlapping-line-segments
Given n points on a 1-D plane, where the ith point (from 0 to n-1) is at x = i, find the number of ways we can draw exactly k non-overlapping line segments such that each segment covers two or more points. The endpoints of each segment must have integral…
leetcode.cn 2026-09-17
🟡1477.find-two-non-overlapping-sub-arrays-each-with-target-sum
🏷️ Tags
#array #hash_table #binary_search #dynamic_programming #sliding_window
🟡1477.find-two-non-overlapping-sub-arrays-each-with-target-sum
🏷️ Tags
#array #hash_table #binary_search #dynamic_programming #sliding_window
Telegraph
find-two-non-overlapping-sub-arrays-each-with-target-sum
给你一个整数数组 arr 和一个整数值 target 。 请你在 arr 中找 两个互不重叠的子数组 且它们的和都等于 target 。可能会有多种方案,请你返回满足要求的两个子数组长度和的 最小值 。 请返回满足要求的最小长度和,如果无法找到这样的两个子数组,请返回 -1 。 示例 1: 输入:arr = [3,2,2,4,3], target = 3 输出:2 解释:只有两个子数组和为 3 ([3] 和 [3])。它们的长度和为 2 。 示例 2: 输入:arr = [7,3,4,7], target…
leetcode.com 2026-09-17
🟡1477.find-two-non-overlapping-sub-arrays-each-with-target-sum
🏷️ Tags
#array #hash_table #binary_search #dynamic_programming #sliding_window
🟡1477.find-two-non-overlapping-sub-arrays-each-with-target-sum
🏷️ Tags
#array #hash_table #binary_search #dynamic_programming #sliding_window
Telegraph
find-two-non-overlapping-sub-arrays-each-with-target-sum
You are given an array of integers arr and an integer target. You have to find two non-overlapping sub-arrays of arr each with a sum equal target. There can be multiple answers so you have to find an answer where the sum of the lengths of the two sub-arrays…
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: