mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 23:41:41 +08:00
update
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "1393",
|
||||
"questionFrontendId": "5269",
|
||||
"questionFrontendId": "2218",
|
||||
"categoryTitle": "Algorithms",
|
||||
"boundTopicId": 1366027,
|
||||
"title": "Maximum Value of K Coins From Piles",
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>一张桌子上总共有 <code>n</code> 个硬币 <b>栈</b> 。每个栈有 <strong>正整数</strong> 个带面值的硬币。</p>\n\n<p>每一次操作中,你可以从任意一个栈的 <strong>顶部</strong> 取出 1 个硬币,从栈中移除它,并放入你的钱包里。</p>\n\n<p>给你一个列表 <code>piles</code> ,其中 <code>piles[i]</code> 是一个整数数组,分别表示第 <code>i</code> 个栈里 <strong>从顶到底</strong> 的硬币面值。同时给你一个正整数 <code>k</code> ,请你返回在 <strong>恰好</strong> 进行 <code>k</code> 次操作的前提下,你钱包里硬币面值之和 <strong>最大为多少</strong> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2019/11/09/e1.png\" style=\"width: 600px; height: 243px;\" /></p>\n\n<pre>\n<b>输入:</b>piles = [[1,100,3],[7,8,9]], k = 2\n<b>输出:</b>101\n<strong>解释:</strong>\n上图展示了几种选择 k 个硬币的不同方法。\n我们可以得到的最大面值为 101 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>piles = [[100],[100],[100],[100],[100],[100],[1,1,1,1,1,1,700]], k = 7\n<b>输出:</b>706\n<strong>解释:\n</strong>如果我们所有硬币都从最后一个栈中取,可以得到最大面值和。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>n == piles.length</code></li>\n\t<li><code>1 <= n <= 1000</code></li>\n\t<li><code>1 <= piles[i][j] <= 10<sup>5</sup></code></li>\n\t<li><code>1 <= k <= sum(piles[i].length) <= 2000</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 15,
|
||||
"likes": 27,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -137,7 +137,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"2.5K\", \"totalSubmission\": \"5.3K\", \"totalAcceptedRaw\": 2490, \"totalSubmissionRaw\": 5256, \"acRate\": \"47.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"3.4K\", \"totalSubmission\": \"6.8K\", \"totalAcceptedRaw\": 3414, \"totalSubmissionRaw\": 6776, \"acRate\": \"50.4%\"}",
|
||||
"hints": [
|
||||
"For each pile i, what will be the total value of coins we can collect if we choose the first j coins?",
|
||||
"How can we use dynamic programming to combine the results from different piles to find the most optimal answer?"
|
||||
|
Reference in New Issue
Block a user