Amdocs Interview Question

find pair on given sum in sorted array in O(n)

Interview Answer

Anonymous

Aug 2, 2021

2 indexes, one from the start and one from the end. and sum them up, if the sum is larger decrement the index and if bigger increment the index.