GeeksforGeeks » Interview Questions
Find n numbers that sum upto a given number
(2 posts)-
eg:
Find a pair of numbers that sum up to zero (or any other number), then find three (and then four) numbers that sum up to zero .. so on -
if array is unsorted then we have to use backtracking with possible DP as u r interested to find all such group that compose to given number , & it can seen similar to coin change problem without repeatation
also question needs to be more specific as o/p will vary
it will help you out http://geeksforgeeks.org/?p=7103 & see comments as well
correct me if anything wrong
Shashank
Reply
You must log in to post.