โ† Barclays questions

Find numbers with difference k and minimal sum

Filed under Barclays

Given an array of integers and an integer k, find a pair of numbers whose absolute difference is equal to k and whose sum is as small as possible.

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 Barclays questions

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