Cisco interview question

Select closest three elements sum to target.

Interview Answer

Anonymous

19 Aug 2024

Sort the array. Take a loop to pick one element. Take two pointers and roam on the leftover part to pick the closest sum.