GeeksforGeeks » Interview Questions

Find n numbers that sum upto a given number

(2 posts)
  • Started 11 months ago by geek
  • Latest reply from wgpshashank
  1. geek
    guest
    Posted 11 months ago #

    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

  2. wgpshashank

    Posted 11 months ago #

    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.

RSS feed for this topic