Google interview question

String manipulation and dynamic programming