Microsoft interview question

Leetcode style DP question then string manipulation