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:
leetcode.cn 2026-10-15
🟢2913.subarrays-distinct-element-sum-of-squares-i
🏷️ Tags
#binary_indexed_tree #segment_tree #array #hash_table
🟢2913.subarrays-distinct-element-sum-of-squares-i
🏷️ Tags
#binary_indexed_tree #segment_tree #array #hash_table
Telegraph
subarrays-distinct-element-sum-of-squares-i
给你一个下标从 0 开始的整数数组 nums 。 定义 nums 一个子数组的 不同计数 值如下:
leetcode.com 2026-10-15
🟢2913.subarrays-distinct-element-sum-of-squares-i
🏷️ Tags
#binary_indexed_tree #segment_tree #array #hash_table
🟢2913.subarrays-distinct-element-sum-of-squares-i
🏷️ Tags
#binary_indexed_tree #segment_tree #array #hash_table
Telegraph
subarrays-distinct-element-sum-of-squares-i
You are given a 0-indexed integer array nums. The distinct count of a subarray of nums is defined as: