Amazon interview question

String manipulation and DP problems.