Too Long; Didn't Read
A problem that can be broken into several chunks and then combined them to get the optimum solution is known as an optimal substructure. The problem we are going to solve has the same characteristic as recursion. The main task is to find the minimum number of operations needed to convert word1 to word2. We need to ask, have we incurred any operation, no. To convert a character into another, first, we need to figure out the number of actions that were needed. And somewhere we have to store the previous number of. actions to calculate the current one.