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-06
🟡921.minimum-add-to-make-parentheses-valid
🏷️ Tags
#stack #greedy #string #bracket_sequences
🟡921.minimum-add-to-make-parentheses-valid
🏷️ Tags
#stack #greedy #string #bracket_sequences
Telegraph
minimum-add-to-make-parentheses-valid
只有满足下面几点之一,括号字符串才是有效的:
leetcode.com 2026-10-06
🟡921.minimum-add-to-make-parentheses-valid
🏷️ Tags
#stack #greedy #string #bracket_sequences
🟡921.minimum-add-to-make-parentheses-valid
🏷️ Tags
#stack #greedy #string #bracket_sequences
Telegraph
minimum-add-to-make-parentheses-valid
A parentheses string is valid if and only if:
leetcode.cn 2026-10-07
🔴301.remove-invalid-parentheses
🏷️ Tags
#breadth_first_search #string #backtracking
🔴301.remove-invalid-parentheses
🏷️ Tags
#breadth_first_search #string #backtracking
Telegraph
remove-invalid-parentheses
给你一个由若干括号和字母组成的字符串 s ,删除最小数量的无效括号,使得输入的字符串有效。 返回所有可能的结果。答案可以按 任意顺序 返回。 示例 1: 输入:s = "()())()" 输出:["(())()","()()()"] 示例 2: 输入:s = "(a)())()" 输出:["(a())()","(a)()()"] 示例 3: 输入:s = ")(" 输出:[""] 提示:
leetcode.com 2026-10-07
🔴301.remove-invalid-parentheses
🏷️ Tags
#breadth_first_search #string #backtracking
🔴301.remove-invalid-parentheses
🏷️ Tags
#breadth_first_search #string #backtracking
Telegraph
remove-invalid-parentheses
Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid. Return a list of unique strings that are valid with the minimum number of removals. You may return the answer in any order.…
leetcode.cn 2026-10-09
🟡1541.minimum-insertions-to-balance-a-parentheses-string
🏷️ Tags
#stack #greedy #string #bracket_sequences
🟡1541.minimum-insertions-to-balance-a-parentheses-string
🏷️ Tags
#stack #greedy #string #bracket_sequences
Telegraph
minimum-insertions-to-balance-a-parentheses-string
给你一个括号字符串 s ,它只包含字符 '(' 和 ')' 。一个括号字符串被称为平衡的当它满足:
leetcode.com 2026-10-09
🟡1541.minimum-insertions-to-balance-a-parentheses-string
🏷️ Tags
#stack #greedy #string #bracket_sequences
🟡1541.minimum-insertions-to-balance-a-parentheses-string
🏷️ Tags
#stack #greedy #string #bracket_sequences
Telegraph
minimum-insertions-to-balance-a-parentheses-string
Given a parentheses string s containing only the characters '(' and ')'. A parentheses string is balanced if:
leetcode.cn 2026-10-10
🟡2333.minimum-sum-of-squared-difference
🏷️ Tags
#greedy #array #binary_search #sorting #heap_priority_queue
🟡2333.minimum-sum-of-squared-difference
🏷️ Tags
#greedy #array #binary_search #sorting #heap_priority_queue
Telegraph
minimum-sum-of-squared-difference
给你两个下标从 0 开始的整数数组 nums1 和 nums2 ,长度为 n 。 数组 nums1 和 nums2 的 差值平方和 定义为所有满足 0 <= i < n 的 (nums1[i] - nums2[i])2 之和。 同时给你两个正整数 k1 和 k2 。你可以将 nums1 中的任意元素 +1 或者 -1 至多 k1 次。类似的,你可以将 nums2 中的任意元素 +1 或者 -1 至多 k2 次。 请你返回修改数组 nums1 至多 k1 次且修改数组 nums2 至多 k2 次后的最小 差值平方和 。…
leetcode.com 2026-10-10
🟡2333.minimum-sum-of-squared-difference
🏷️ Tags
#greedy #array #binary_search #sorting #heap_priority_queue
🟡2333.minimum-sum-of-squared-difference
🏷️ Tags
#greedy #array #binary_search #sorting #heap_priority_queue
Telegraph
minimum-sum-of-squared-difference
You are given two positive 0-indexed integer arrays nums1 and nums2, both of length n. The sum of squared difference of arrays nums1 and nums2 is defined as the sum of (nums1[i] - nums2[i])2 for each 0 <= i < n. You are also given two positive integers k1…
leetcode.cn 2026-10-12
🔴2897.apply-operations-on-array-to-maximize-sum-of-squares
🏷️ Tags
#greedy #bit_manipulation #array #hash_table
🔴2897.apply-operations-on-array-to-maximize-sum-of-squares
🏷️ Tags
#greedy #bit_manipulation #array #hash_table
Telegraph
apply-operations-on-array-to-maximize-sum-of-squares
给你一个下标从 0 开始的整数数组 nums 和一个 正 整数 k 。 你可以对数组执行以下操作 任意次 :
leetcode.com 2026-10-12
🔴2897.apply-operations-on-array-to-maximize-sum-of-squares
🏷️ Tags
#greedy #bit_manipulation #array #hash_table
🔴2897.apply-operations-on-array-to-maximize-sum-of-squares
🏷️ Tags
#greedy #bit_manipulation #array #hash_table
Telegraph
apply-operations-on-array-to-maximize-sum-of-squares
You are given a 0-indexed integer array nums and a positive integer k. You can do the following operation on the array any number of times: