From c9be411a60db7a65fdb608b7985760762fea9cdf Mon Sep 17 00:00:00 2001 From: CyC2018 Date: Fri, 30 Oct 2026 20:18:07 +0800 Subject: [PATCH] =?UTF-8?q?Update=2063.=20=E8=82=A1=E7=A5=A8=E7=9A=84?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=88=A9=E6=B6=A6.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新题目链接与方法名称,补充股票多次买卖及包含限制条件等相关拓展题目的指引链接。 --- notes/63. 股票的最大利润.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/notes/63. 股票的最大利润.md b/notes/63. 股票的最大利润.md index b936361c..c2cddc66 100644 --- a/notes/63. 股票的最大利润.md +++ b/notes/63. 股票的最大利润.md @@ -2,7 +2,7 @@ ## 题目链接 -[Leetcode:121. Best Time to Buy and Sell Stock ](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/) +[Leetcode](https://leetcode.cn/problems/gu-piao-de-zui-da-li-run-lcof/) ## 题目描述 @@ -14,8 +14,10 @@ 使用贪心策略,假设第 i 轮进行卖出操作,买入操作价格应该在 i 之前并且价格最低。因此在遍历数组时记录当前最低的买入价格,并且尝试将每个位置都作为卖出价格,取收益最大的即可。 +可以多次买卖的版本见[买卖股票的最大收益 II](Leetcode%20题解%20-%20贪心思想.md#6-买卖股票的最大收益-ii),有冷却期、手续费或交易次数限制的版本见[股票交易](Leetcode%20题解%20-%20动态规划.md#股票交易)。 + ```java -public int maxProfit(int[] prices) { +public int bestTiming(int[] prices) { if (prices == null || prices.length == 0) return 0; int soFarMin = prices[0];