Find Kth Largest Sum Pair
Given two arrays sorted in ascending order, we want to find the Kth
largest sum such that one element is picked from 1st array and the second
element is picked from the 2nd array.
I am already aware of the O(Klogk) solution , using Max-Heap given here .
I've read somewhere that there exists a O(k) solution for this (using two
pointers may be) , which i am unable to figure out .
Any ideas/approaches people ?
No comments:
Post a Comment