Dynamic Programming on Strings and Sequences
So far, our exploration of dynamic programming has primarily focused on combinatorial problems and calculating terms of integer sequences with defined formulae. Now, we will consider another one of DP's most common uses, that is, working with patterns in sequences of data. The most typical scenarios in which a programmer would use DP for this purpose generally concern searching, comparing, and constructing strings.
As software developers, we often work collaboratively with several individuals who all have the ability to make contributions and modifications to the same project. Since the possibility always exists that a programmer may inadvertently introduce a bug into the code, or that the team may try a different approach for a given feature and then decide to return to their original method, it becomes extremely important to have some system of version control. In the event that a feature that was working recently mysteriously develops...