leetcode.cn 2026-09-23
🟡1658.minimum-operations-to-reduce-x-to-zero
🏷️ Tags
#array #hash_table #binary_search #prefix_sum #sliding_window
🟡1658.minimum-operations-to-reduce-x-to-zero
🏷️ Tags
#array #hash_table #binary_search #prefix_sum #sliding_window
Telegraph
minimum-operations-to-reduce-x-to-zero
给你一个整数数组 nums 和一个整数 x 。每一次操作时,你应当移除数组 nums 最左边或最右边的元素,然后从 x 中减去该元素的值。请注意,需要 修改 数组以供接下来的操作使用。 如果可以将 x 恰好 减到 0 ,返回 最小操作数 ;否则,返回 -1 。 示例 1: 输入:nums = [1,1,4,2,3], x = 5 输出:2 解释:最佳解决方案是移除后两个元素,将 x 减到 0 。 示例 2: 输入:nums = [5,6,7,8,9], x = 4 输出:-1 示例 3: 输入:nums…
leetcode.com 2026-09-23
🟡1658.minimum-operations-to-reduce-x-to-zero
🏷️ Tags
#array #hash_table #binary_search #prefix_sum #sliding_window
🟡1658.minimum-operations-to-reduce-x-to-zero
🏷️ Tags
#array #hash_table #binary_search #prefix_sum #sliding_window
Telegraph
minimum-operations-to-reduce-x-to-zero
You are given an integer array nums and an integer x. In one operation, you can either remove the leftmost or the rightmost element from the array nums and subtract its value from x. Note that this modifies the array for future operations. Return the minimum…
leetcode.com 2026-09-26
🟡1807.evaluate-the-bracket-pairs-of-a-string
🏷️ Tags
#array #hash_table #string
🟡1807.evaluate-the-bracket-pairs-of-a-string
🏷️ Tags
#array #hash_table #string
Telegraph
evaluate-the-bracket-pairs-of-a-string
You are given a string s that contains some bracket pairs, with each pair containing a non-empty key.
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: