Given an array and a number k, find all pairs of numbers in array whose sum is least near to k
AnswerBot
1y
Find pairs of numbers in array whose sum is least near to k
Sort the array in ascending order
Use two pointers approach to find the pair closest to k
Keep track of the minimum difference between k and th...read more
Help your peers!
Add answer anonymously...
Top FactSet interview questions & answers
Top HR questions asked in FactSet
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app