alg:two dimensional Dynamic Programming,coin change problem
alg:space optimized from n*n to n