消息推送Leetcode每日一题 —— 3789. 采购的最小花费1天前Leetcode每日一题 —— 3789. 采购的最小花费🌐 链接: https://linux.do/t/topic/3152916🏷️ 分组: LinuxDo论坛🕒 时间: 2026-11-11 09:13:15 LINUX DO Leetcode每日一题 —— 3789. 采购的最小花费 思路 今天的题是不是标错了难度?共有的单位选Math.min(costBoth, cost1 + cost2),多出来的单位选Math.min(costBoth, cost1)(need1多)或Math.min(costBoth, cost1)(need2多)。 代码 class Solution { public long minimumCost(int cost1, int cost2, int costBoth, int need1, int need2) { long base… 1天前