Interview question: three arrays and O(N*N)
This can be done in O(1) space and O(N2) time. First lets solve a simpler problem: Given two arrays A and B pick one element from each so that their sum is equal to given number K. Sort both the arrays which takes O(NlogN). Take pointers i and j so that i points to the … Read more