@aakash: you are given an array A of k values which contain int values in
sorted (asec) order. Now u can understand it as if you have to create a new
array which contains all elements , and sum of every two elements taken at a
time and sum of all three elements taken at a time.
eg if array is
WELL my answer is complexity is between n^2 to n
SOLUTION LIES WITHIN THE SOLUTION Array AS:
A= {3 4 5 15 19 20 25}
first we have in B={ 3,4}now we have PTR1 @ 5andPTR2 always
one less thab PTR1 means @ 4
now from B[0] upto the same element ie 4 add ptr2 and
ou are given an array A of k values which contain int values in sorted
(asec) order. Find top k values (asec) which can either be the number from
the array A, or sum of any two numbers from A or sum of any three numbers
from A. So, if A's values are represented as : a1,a2,...,ak , the possible