Swap values to equalize array sums
Given two integer arrays of potentially different lengths, find all pairs (a, b) where a belongs to the first array and b belongs to the second array such that swapping them results in both arrays having equal sums. Arrays may contain duplicate values.
Asked at:
eBay
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late July, 2026
eBay
Senior
Given two integer arrays, find all pairs (a, b) where a belongs to the first array and b belongs to the second array such that swapping them makes the sums of both arrays equal. Arrays can have different lengths and duplicate values.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.