Dynamic Programming (DP) is a technique in computer programming that helps to efficiently solve a class of problems that have overlapping subproblems and optimal substructure. It is mainly an optimization over plain recursion, where a recursive solution that has repeated calls for the same inputs is optimized. DP is not a particular algorithm but a way of thinking. It involves breaking down a problem into smaller subproblems, which in turn are divided into smaller subproblems, and if there are overlapping among these subproblems, then the solutions to these subproblems can be saved for future reference. This method of solving a solution is referred to as dynamic programming. DP is used to solve problems that involve repeatedly calculating the value of the same subproblems to find the optimum solution. DP is an optimization technique for recursive solutions and is the preferred technique for solving recursive functions that make repeated calls to the same inputs.