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:
leetcode.cn 2026-10-16
🔴2916.subarrays-distinct-element-sum-of-squares-ii
🏷️ Tags
#binary_indexed_tree #segment_tree #array #hash_table
🔴2916.subarrays-distinct-element-sum-of-squares-ii
🏷️ Tags
#binary_indexed_tree #segment_tree #array #hash_table
Telegraph
subarrays-distinct-element-sum-of-squares-ii
给你一个下标从 0 开始的整数数组 nums 。 定义 nums 一个子数组的 不同计数 值如下:
leetcode.com 2026-10-16
🔴2916.subarrays-distinct-element-sum-of-squares-ii
🏷️ Tags
#binary_indexed_tree #segment_tree #array #hash_table
🔴2916.subarrays-distinct-element-sum-of-squares-ii
🏷️ Tags
#binary_indexed_tree #segment_tree #array #hash_table
Telegraph
subarrays-distinct-element-sum-of-squares-ii
You are given a 0-indexed integer array nums. The distinct count of a subarray of nums is defined as:
leetcode.cn 2026-10-18
🔴1569.number-of-ways-to-reorder-array-to-get-same-bst
🏷️ Tags
#tree #union_find #binary_search_tree #memoization #array #math #divide_and_conquer #dynamic_programming #binary_tree #combinatorics #fermats_little_theorem
🔴1569.number-of-ways-to-reorder-array-to-get-same-bst
🏷️ Tags
#tree #union_find #binary_search_tree #memoization #array #math #divide_and_conquer #dynamic_programming #binary_tree #combinatorics #fermats_little_theorem
Telegraph
number-of-ways-to-reorder-array-to-get-same-bst
给你一个数组 nums 表示 1 到 n 的一个排列。我们按照元素在 nums 中的顺序依次插入一个初始为空的二叉搜索树(BST)。请你统计将 nums 重新排序后,统计满足如下条件的方案数:重排后得到的二叉搜索树与 nums 原本数字顺序得到的二叉搜索树相同。
leetcode.com 2026-10-18
🔴1569.number-of-ways-to-reorder-array-to-get-same-bst
🏷️ Tags
#tree #union_find #binary_search_tree #memoization #array #math #divide_and_conquer #dynamic_programming #binary_tree #combinatorics #fermats_little_theorem
🔴1569.number-of-ways-to-reorder-array-to-get-same-bst
🏷️ Tags
#tree #union_find #binary_search_tree #memoization #array #math #divide_and_conquer #dynamic_programming #binary_tree #combinatorics #fermats_little_theorem
Telegraph
number-of-ways-to-reorder-array-to-get-same-bst
Given an array nums that represents a permutation of integers from 1 to n. We are going to construct a binary search tree (BST) by inserting the elements of nums in order into an initially empty BST. Find the number of different ways to reorder nums so that…
leetcode.cn 2026-10-19
🟢2089.find-target-indices-after-sorting-array
🏷️ Tags
#array #binary_search #sorting
🟢2089.find-target-indices-after-sorting-array
🏷️ Tags
#array #binary_search #sorting
Telegraph
find-target-indices-after-sorting-array
给你一个下标从 0 开始的整数数组 nums 以及一个目标元素 target 。 目标下标 是一个满足 nums[i] == target 的下标 i 。 将 nums 按 非递减 顺序排序后,返回由 nums 中目标下标组成的列表。如果不存在目标下标,返回一个 空 列表。返回的列表必须按 递增 顺序排列。 示例 1: 输入:nums = [1,2,5,2,3], target = 2 输出:[1,2] 解释:排序后,nums 变为 [1,2,2,3,5] 。 满足 nums[i] == 2 的下标是…
leetcode.com 2026-10-19
🟢2089.find-target-indices-after-sorting-array
🏷️ Tags
#array #binary_search #sorting
🟢2089.find-target-indices-after-sorting-array
🏷️ Tags
#array #binary_search #sorting
Telegraph
find-target-indices-after-sorting-array
You are given a 0-indexed integer array nums and a target element target. A target index is an index i such that nums[i] == target. Return a list of the target indices of nums after sorting nums in non-decreasing order. If there are no target indices, return…