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…