leetcode.cn 2026-09-12
🔴3414.maximum-score-of-non-overlapping-intervals
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
🔴3414.maximum-score-of-non-overlapping-intervals
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
Telegraph
maximum-score-of-non-overlapping-intervals
给你一个二维整数数组 intervals,其中 intervals[i] = [li, ri, weighti]。区间 i 的起点为 li,终点为 ri,权重为 weighti。你最多可以选择 4 个互不重叠 的区间。所选择区间的 得分 定义为这些区间权重的总和。 返回一个至多包含 4 个下标且 字典序最小 的数组,表示从 intervals 中选中的互不重叠且得分最大的区间。
leetcode.com 2026-09-12
🔴3414.maximum-score-of-non-overlapping-intervals
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
🔴3414.maximum-score-of-non-overlapping-intervals
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
Telegraph
maximum-score-of-non-overlapping-intervals
You are given a 2D integer array intervals, where intervals[i] = [li, ri, weighti]. Interval i starts at position li and ends at ri, and has a weight of weighti. You can choose up to 4 non-overlapping intervals. The score of the chosen intervals is defined…
leetcode.cn 2026-09-15
🔴2472.maximum-number-of-non-overlapping-palindrome-substrings
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
🔴2472.maximum-number-of-non-overlapping-palindrome-substrings
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
Telegraph
maximum-number-of-non-overlapping-palindrome-substrings
给你一个字符串 s 和一个 正 整数 k 。 从字符串 s 中选出一组满足下述条件且 不重叠 的子字符串:
leetcode.com 2026-09-15
🔴2472.maximum-number-of-non-overlapping-palindrome-substrings
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
🔴2472.maximum-number-of-non-overlapping-palindrome-substrings
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
Telegraph
maximum-number-of-non-overlapping-palindrome-substrings
You are given a string s and a positive integer k. Select a set of non-overlapping substrings from the string s that satisfy the following conditions:
leetcode.cn 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
给你一维空间的 n 个点,其中第 i 个点(编号从 0 到 n-1)位于 x = i 处,请你找到 恰好 k 个不重叠 线段且每个线段至少覆盖两个点的方案数。线段的两个端点必须都是 整数坐标 。这 k 个线段不需要全部覆盖全部 n 个点,且它们的端点 可以 重合。 请你返回 k 个不重叠线段的方案数。由于答案可能很大,请将结果对 109 + 7 取余 后返回。 示例 1: 输入:n = 4, k = 2 输出:5 解释:如图所示,两个线段分别用红色和蓝色标出。 上图展示了 5 种不同的方案 {(0,2)…
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: