Problem: Given a set [1,2,3,4], how many subsets there are in which each sum is equal to 4 ?
Solution: Solution is programmed using ruby in dynamic programming. The idea is set up a matrix in which each cell in x axis represents a number in set. And in y axis, each cell represent their corresponding sum.
For example, in this case, 1,2,3,4 will be numbered in x axis and 1,2,3,4 (incrementally) will be numbered in y axis.
Then we set up boudary condtions. The algorithm solves problems in multiple subproblems and each subproblem memoize the optimal solution from the previous iteration.
For furthur detailed algorithm, visit Dynamic Programming
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 
