Microsoft interview question

string manipulation using dynamic programming or brute force