Amazon Interview Question

Questions from dynamic programming and string