mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 11:21:42 +08:00
add leetcode problem-cn part2
This commit is contained in:
22
算法题(国内版)/problem (English)/交换和(English) [sum-swap-lcci].html
Normal file
22
算法题(国内版)/problem (English)/交换和(English) [sum-swap-lcci].html
Normal 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 <= array1.length, array2.length <= 100000</code></li>
|
||||
</ul>
|
Reference in New Issue
Block a user