โ† Nagarro questions

Find Pair with Sum Closest to Target

Filed under Nagarro

Given two integer arrays arr1 and arr2, and a target integer target, find a pair (u, v) such that u is from arr1 and v is from arr2, and |(u + v) - target| is minimized. Return the pair [u, v].

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Nagarro questions

Collected from public candidate posts and coding forums. Updated Nov 2026.