title: Number of ways to add up to a sum S with N numbers
body: <p>Say S = 5 and N = 3 the solutions would look like - &lt;0,0,5> &lt;0,1,4> &lt;0,2,3> &lt;0,3,2> &lt;5,0,0> &lt;2,3,0> &lt;3,2,0> &lt;1,2,2> etc etc. </p>
  
  <p>In the general case, N nested loops can be used to solve the problem. Run N nested loop, inside them check if the loop variables add upto S.</p>
  
  <p>If we do not know N ahead of time, we can use a recursive solution. In each level, run a loop starting from 0 to N, and then call the function itself again. When we reach a depth of N, see if the numbers obtained add up to S. </p>
  
  <p>Any other dynamic programming solution? </p>