mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-25 14:58:56 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个整数数组 <code>prices</code> ,它的第<em> </em><code>i</code> 个元素 <code>prices[i]</code> 是一支给定的股票在第 <code>i</code><em> </em>天的价格。</p>\n\n<p>设计一个算法来计算你所能获取的最大利润。你最多可以完成 <strong>k</strong> 笔交易。</p>\n\n<p><strong>注意:</strong>你不能同时参与多笔交易(你必须在再次购买前出售掉之前的股票)。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>k = 2, prices = [2,4,1]\n<strong>输出:</strong>2\n<strong>解释:</strong>在第 1 天 (股票价格 = 2) 的时候买入,在第 2 天 (股票价格 = 4) 的时候卖出,这笔交易所能获得利润 = 4-2 = 2 。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>k = 2, prices = [3,2,6,5,0,3]\n<strong>输出:</strong>7\n<strong>解释:</strong>在第 2 天 (股票价格 = 2) 的时候买入,在第 3 天 (股票价格 = 6) 的时候卖出, 这笔交易所能获得利润 = 6-2 = 4 。\n 随后,在第 5 天 (股票价格 = 0) 的时候买入,在第 6 天 (股票价格 = 3) 的时候卖出, 这笔交易所能获得利润 = 3-0 = 3 。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 <= k <= 100</code></li>\n\t<li><code>0 <= prices.length <= 1000</code></li>\n\t<li><code>0 <= prices[i] <= 1000</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 692,
|
||||
"likes": 709,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Best Time to Buy and Sell Stock\", \"titleSlug\": \"best-time-to-buy-and-sell-stock\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u4e70\\u5356\\u80a1\\u7968\\u7684\\u6700\\u4f73\\u65f6\\u673a\"}, {\"title\": \"Best Time to Buy and Sell Stock II\", \"titleSlug\": \"best-time-to-buy-and-sell-stock-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u4e70\\u5356\\u80a1\\u7968\\u7684\\u6700\\u4f73\\u65f6\\u673a II\"}, {\"title\": \"Best Time to Buy and Sell Stock III\", \"titleSlug\": \"best-time-to-buy-and-sell-stock-iii\", \"difficulty\": \"Hard\", \"translatedTitle\": \"\\u4e70\\u5356\\u80a1\\u7968\\u7684\\u6700\\u4f73\\u65f6\\u673a III\"}]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"114.3K\", \"totalSubmission\": \"280.1K\", \"totalAcceptedRaw\": 114338, \"totalSubmissionRaw\": 280086, \"acRate\": \"40.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"120.6K\", \"totalSubmission\": \"293K\", \"totalAcceptedRaw\": 120612, \"totalSubmissionRaw\": 293049, \"acRate\": \"41.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
||||
Reference in New Issue
Block a user