Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

find sum of huge subset from given set

currently I am having a linked list (named as "input") containing 1Million of integers in it ( let's assume data from 1 to 1000000) All the numbers are sorted in ascending/increasing order. list can have duplicate numbers in it.

I have k=369742

now i need to find the set whose sum is exactly same as k or nearest upper value to k.

what will be the best approach to solve above. I have designed with backtracking, but time complexity in worst case is more.

can anyone suggest best approach.

Comments