leetcode.cn 2026-01-24
🟡1877.minimize-maximum-pair-sum-in-array
🏷️ Tags
#greedy #array #two_pointers #sorting
🟡1877.minimize-maximum-pair-sum-in-array
🏷️ Tags
#greedy #array #two_pointers #sorting
Telegraph
minimize-maximum-pair-sum-in-array
一个数对 (a,b) 的 数对和 等于 a + b 。最大数对和 是一个数对数组中最大的 数对和 。
leetcode.com 2026-01-24
🟡1877.minimize-maximum-pair-sum-in-array
🏷️ Tags
#greedy #array #two_pointers #sorting
🟡1877.minimize-maximum-pair-sum-in-array
🏷️ Tags
#greedy #array #two_pointers #sorting
Telegraph
minimize-maximum-pair-sum-in-array
The pair sum of a pair (a,b) is equal to a + b. The maximum pair sum is the largest pair sum in a list of pairs.
leetcode.cn 2026-01-25
🟢1984.minimum-difference-between-highest-and-lowest-of-k-scores
🏷️ Tags
#array #sorting #sliding_window
🟢1984.minimum-difference-between-highest-and-lowest-of-k-scores
🏷️ Tags
#array #sorting #sliding_window
Telegraph
minimum-difference-between-highest-and-lowest-of-k-scores
给你一个 下标从 0 开始 的整数数组 nums ,其中 nums[i] 表示第 i 名学生的分数。另给你一个整数 k 。 从数组中选出任意 k 名学生的分数,使这 k 个分数间 最高分 和 最低分 的 差值 达到 最小化 。 返回可能的 最小差值 。 示例 1: 输入:nums = [90], k = 1 输出:0 解释:选出 1 名学生的分数,仅有 1 种方法: - [90] 最高分和最低分之间的差值是 90 - 90 = 0 可能的最小差值是 0 示例 2: 输入:nums = [9,4,1,7]…
leetcode.com 2026-01-25
🟢1984.minimum-difference-between-highest-and-lowest-of-k-scores
🏷️ Tags
#array #sorting #sliding_window
🟢1984.minimum-difference-between-highest-and-lowest-of-k-scores
🏷️ Tags
#array #sorting #sliding_window
Telegraph
minimum-difference-between-highest-and-lowest-of-k-scores
You are given a 0-indexed integer array nums, where nums[i] represents the score of the ith student. You are also given an integer k. Pick the scores of any k students from the array so that the difference between the highest and the lowest of the k scores…
leetcode.cn 2026-01-27
🟡3650.minimum-cost-path-with-edge-reversals
🏷️ Tags
#graph #shortest_path #heap_priority_queue
🟡3650.minimum-cost-path-with-edge-reversals
🏷️ Tags
#graph #shortest_path #heap_priority_queue
Telegraph
minimum-cost-path-with-edge-reversals
给你一个包含 n 个节点的有向带权图,节点编号从 0 到 n - 1。同时给你一个数组 edges,其中 edges[i] = [ui, vi, wi] 表示一条从节点 ui 到节点 vi 的有向边,其成本为 wi。
leetcode.com 2026-01-27
🟡3650.minimum-cost-path-with-edge-reversals
🏷️ Tags
#graph #shortest_path #heap_priority_queue
🟡3650.minimum-cost-path-with-edge-reversals
🏷️ Tags
#graph #shortest_path #heap_priority_queue
Telegraph
minimum-cost-path-with-edge-reversals
You are given a directed, weighted graph with n nodes labeled from 0 to n - 1, and an array edges where edges[i] = [ui, vi, wi] represents a directed edge from node ui to node vi with cost wi. Each node ui has a switch that can be used at most once: when…
leetcode.cn 2026-01-29
🟡2976.minimum-cost-to-convert-string-i
🏷️ Tags
#graph #array #string #shortest_path
🟡2976.minimum-cost-to-convert-string-i
🏷️ Tags
#graph #array #string #shortest_path
Telegraph
minimum-cost-to-convert-string-i
给你两个下标从 0 开始的字符串 source 和 target ,它们的长度均为 n 并且由 小写 英文字母组成。 另给你两个下标从 0 开始的字符数组 original 和 changed ,以及一个整数数组 cost ,其中 cost[i] 代表将字符 original[i] 更改为字符 changed[i] 的成本。 你从字符串 source 开始。在一次操作中,如果 存在 任意 下标 j 满足 cost[j] == z 、original[j] == x 以及 changed[j] == y…
leetcode.com 2026-01-29
🟡2976.minimum-cost-to-convert-string-i
🏷️ Tags
#graph #array #string #shortest_path
🟡2976.minimum-cost-to-convert-string-i
🏷️ Tags
#graph #array #string #shortest_path
Telegraph
minimum-cost-to-convert-string-i
You are given two 0-indexed strings source and target, both of length n and consisting of lowercase English letters. You are also given two 0-indexed character arrays original and changed, and an integer array cost, where cost[i] represents the cost of changing…
leetcode.cn 2026-01-30
🔴2977.minimum-cost-to-convert-string-ii
🏷️ Tags
#graph #trie #array #string #dynamic_programming #shortest_path
🔴2977.minimum-cost-to-convert-string-ii
🏷️ Tags
#graph #trie #array #string #dynamic_programming #shortest_path
Telegraph
minimum-cost-to-convert-string-ii
给你两个下标从 0 开始的字符串 source 和 target ,它们的长度均为 n 并且由 小写 英文字母组成。 另给你两个下标从 0 开始的字符串数组 original 和 changed ,以及一个整数数组 cost ,其中 cost[i] 代表将字符串 original[i] 更改为字符串 changed[i] 的成本。 你从字符串 source 开始。在一次操作中,如果 存在 任意 下标 j 满足 cost[j] == z 、original[j] == x 以及 changed[j] ==…
leetcode.com 2026-01-30
🔴2977.minimum-cost-to-convert-string-ii
🏷️ Tags
#graph #trie #array #string #dynamic_programming #shortest_path
🔴2977.minimum-cost-to-convert-string-ii
🏷️ Tags
#graph #trie #array #string #dynamic_programming #shortest_path
Telegraph
minimum-cost-to-convert-string-ii
You are given two 0-indexed strings source and target, both of length n and consisting of lowercase English characters. You are also given two 0-indexed string arrays original and changed, and an integer array cost, where cost[i] represents the cost of converting…
leetcode.cn 2026-02-01
🟢3010.divide-an-array-into-subarrays-with-minimum-cost-i
🏷️ Tags
#array #enumeration #sorting
🟢3010.divide-an-array-into-subarrays-with-minimum-cost-i
🏷️ Tags
#array #enumeration #sorting
Telegraph
divide-an-array-into-subarrays-with-minimum-cost-i
给你一个长度为 n 的整数数组 nums 。 一个数组的 代价 是它的 第一个 元素。比方说,[1,2,3] 的代价是 1 ,[3,4,1] 的代价是 3 。 你需要将 nums 分成 3 个 连续且没有交集 的子数组。 请你返回这些子数组的 最小 代价 总和 。 示例 1: 输入:nums = [1,2,3,12] 输出:6 解释:最佳分割成 3 个子数组的方案是:[1] ,[2] 和 [3,12] ,总代价为 1 + 2 + 3 = 6 。 其他得到 3 个子数组的方案是: - [1] ,[2,3]…
leetcode.com 2026-02-01
🟢3010.divide-an-array-into-subarrays-with-minimum-cost-i
🏷️ Tags
#array #enumeration #sorting
🟢3010.divide-an-array-into-subarrays-with-minimum-cost-i
🏷️ Tags
#array #enumeration #sorting
Telegraph
divide-an-array-into-subarrays-with-minimum-cost-i
You are given an array of integers nums of length n. The cost of an array is the value of its first element. For example, the cost of [1,2,3] is 1 while the cost of [3,4,1] is 3. You need to divide nums into 3 disjoint contiguous subarrays. Return the minimum…
leetcode.cn 2026-02-02
🔴3013.divide-an-array-into-subarrays-with-minimum-cost-ii
🏷️ Tags
#array #hash_table #sliding_window #heap_priority_queue
🔴3013.divide-an-array-into-subarrays-with-minimum-cost-ii
🏷️ Tags
#array #hash_table #sliding_window #heap_priority_queue
Telegraph
divide-an-array-into-subarrays-with-minimum-cost-ii
给你一个下标从 0 开始长度为 n 的整数数组 nums 和两个 正 整数 k 和 dist 。 一个数组的 代价 是数组中的 第一个 元素。比方说,[1,2,3] 的代价为 1 ,[3,4,1] 的代价为 3 。 你需要将 nums 分割成 k 个 连续且互不相交 的子数组,满足 第二 个子数组与第 k 个子数组中第一个元素的下标距离 不超过 dist 。换句话说,如果你将 nums 分割成子数组 nums[0..(i1 - 1)], nums[i1..(i2 - 1)], ..., nums[ik-1..(n…
leetcode.com 2026-02-02
🔴3013.divide-an-array-into-subarrays-with-minimum-cost-ii
🏷️ Tags
#array #hash_table #sliding_window #heap_priority_queue
🔴3013.divide-an-array-into-subarrays-with-minimum-cost-ii
🏷️ Tags
#array #hash_table #sliding_window #heap_priority_queue
Telegraph
divide-an-array-into-subarrays-with-minimum-cost-ii
You are given a 0-indexed array of integers nums of length n, and two positive integers k and dist. The cost of an array is the value of its first element. For example, the cost of [1,2,3] is 1 while the cost of [3,4,1] is 3. You need to divide nums into…