iCIMS interview question

Dynamic Programming problem