Alice and Bob have candy boxes of various sizes, represented by integer arrays aliceSizes and bobSizes, where aliceSizes[i] is the number of candies in the candy box Alice owns at index i, and bobSizes[j] is the number of candies in the candy box Bob owns at index j.
They wish to exchange exactly one candy box each so that, after the exchange, they both have the same total amount of candy.
Return an integer array containing two elements [aliceSizes[i], bobSizes[j]], where aliceSizes[i] is the size of the candy box Alice trades and bobSizes[j] is the size of the candy box Bob trades. If there are multiple valid answers, you may return any one of them.
Constraints:
aliceSizes.length, bobSizes.length
aliceSizes[i], bobSizes[j]
Alice and Bob have a different total number of candies.
There will be at least one valid answer for the given input.
Alice and Bob have candy boxes of various sizes, represented by integer arrays aliceSizes and bobSizes, where aliceSizes[i] is the number of candies in the candy box Alice owns at index i, and bobSizes[j] is the number of candies in the candy box Bob owns at index j.
They wish to exchange exactly one candy box each so that, after the exchange, they both have the same total amount of candy.
Return an integer array containing two elements [aliceSizes[i], bobSizes[j]], where aliceSizes[i] is the size of the candy box Alice trades and bobSizes[j] is the size of the candy box Bob trades. If there are multiple valid answers, you may return any one of them.
Constraints:
aliceSizes.length, bobSizes.length
aliceSizes[i], bobSizes[j]
Alice and Bob have a different total number of candies.
There will be at least one valid answer for the given input.