mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-21 13:06:47 +08:00
update
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<p>给你一个 <strong>下标从 1 开始的</strong> 整数数组 <code>prices</code> ,其中 <code>prices[i]</code> 表示你购买第 <code>i</code> 个水果需要花费的金币数目。</p>
|
||||
<p>给你一个 <strong>下标从 0 开始的</strong> 整数数组 <code>prices</code> ,其中 <code>prices[i]</code> 表示你购买第 <code>i + 1</code> 个水果需要花费的金币数目。</p>
|
||||
|
||||
<p>水果超市有如下促销活动:</p>
|
||||
|
||||
<ul>
|
||||
<li>如果你花费 <code>prices[i]</code> 购买了下标为 <code>i</code> 的水果,那么你可以免费获得下标范围在 <code>[i + 1, i + i]</code> 的水果。</li>
|
||||
<li>如果你花费 <code>prices[i]</code> 购买了下标为 <code>i + 1</code> 的水果,那么你可以免费获得下标范围在 <code>[i + 1, i + i]</code> 的水果。</li>
|
||||
</ul>
|
||||
|
||||
<p><strong>注意</strong> ,即使你 <strong>可以</strong> 免费获得水果 <code>j</code> ,你仍然可以花费 <code>prices[j]</code> 个金币去购买它以获得它的奖励。</p>
|
||||
<p><strong>注意</strong> ,即使你 <strong>可以</strong> 免费获得水果 <code>j</code> ,你仍然可以花费 <code>prices[j - 1]</code> 个金币去购买它以获得它的奖励。</p>
|
||||
|
||||
<p>请你返回获得所有水果所需要的 <strong>最少</strong> 金币数。</p>
|
||||
|
||||
|
Reference in New Issue
Block a user