Dynamic programming is a technique of solving a problem by first solving
the smallest version of that problem, and using that result to solve
the next smallest version, until arriving at the original problem.
For example, to calculate the
of 5, first get the factorial of 1, which is given, and multiply that by
2 to get the factorial of 2. Then multiply that result by 3 to get the
factorial of 3, etc.