1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 03:11:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2023-12-09 18:53:53 +08:00
parent c9b1bf36a8
commit 9bc4722a45
349 changed files with 15897 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<p>购物车内的商品价格按照升序记录于数组 <code>price</code>。请在购物车中找到两个商品的价格总和刚好是 <code>target</code>。若存在多种情况,返回任一结果即可。</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>price = [3, 9, 12, 15], target = 18
<strong>输出:</strong>[3,15] 或者 [15,3]
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>price = [8, 21, 27, 34, 52, 66], target = 61
<strong>输出:</strong>[27,34] 或者 [34,27]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= price.length &lt;= 10^5</code></li>
<li><code>1 &lt;= price[i] &lt;= 10^6</code></li>
<li><code>1 &lt;= target &lt;= 2*10^6</code></li>
</ul>