1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 11:21:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part2

This commit is contained in:
2022-03-27 20:38:29 +08:00
parent 5a4fa6db12
commit 0fc7f4b734
1617 changed files with 134637 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<p>Given two arrays of integers, find a pair of values (one value from each array) that you can swap to give the two arrays the same sum.</p>
<p>Return an array, where the first element is the element in the first array that will be swapped, and the second element is another one in the second array. If there are more than one answers, return any one of them. If there is no answer, return an empty array.</p>
<p><strong>Example:</strong></p>
<pre>
<strong>Input:</strong> array1 = [4, 1, 2, 1, 1, 2], array2 = [3, 6, 3, 3]
<strong>Output:</strong> [1, 3]
</pre>
<p><strong>Example:</strong></p>
<pre>
<strong>Input:</strong> array1 = <code>[1, 2, 3], array2 = [4, 5, 6]</code>
<strong>Output: </strong>[]</pre>
<p><strong>Note: </strong></p>
<ul>
<li><code>1 &lt;= array1.length, array2.length &lt;= 100000</code></li>
</ul>