Given a sorted array of integers and a target value, find a pair of elements whose sum is closest to the target. Additionally, consider finding a pair whose difference is closest to the target.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.